zmzimpl
2017-01-17 15:09刚学Struts2,访问index.jsp页面正常,访问login.jsp页面就报错
我用的是通配符的方式访问,输入
http://localhost:8088/TestStruts/TestStruts_index.action时可以跳转到index.jsp页面,
但输入http://localhost:8088/TestStruts/TestStruts_login.action时,
就报There is no Action mapped for namespace [/] and action name [TestStruts_login] associated with context path [/TestStruts].
struts.xml代码如下:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<constant name="struts.i18n.encoding" value="UTF-8"></constant>
<constant name="struts.action.extension" value="do,action"></constant>
<constant name="struts.serve.static.browserCache" value="false"></constant>
<constant name="struts.configuration.xml.reload" value="true"></constant>
<constant name="struts.devMode" value="true"></constant>
<constant name="struts.enable.DynamicMethodInvocation" value="false"></constant>
<package name="default" namespace="/" extends="struts-default">
<action name="*_*" method="{2}" class="com.test.action.{1}" >
<result name="login">/login.jsp</result>
<result name="index">/{2}.jsp</result>
</action>
</package>
麻烦大神解惑~
- 点赞
- 回答
- 收藏
- 复制链接分享
5条回答
为你推荐
- struts2导入多个xml,第一个没问题,第二个报错
- struts
- spring
- 0个回答
- struts2里,如何实现这种登录错误后在当前页面提示一次的需求
- struts
- 0个回答
- jsp中如何接收struts1中action中的对象属性值
- struts
- 0个回答
- struts中直接通过jsp来如何调用action
- struts
- java
- jsp
- 0个回答
- s2sh整合问题 tomcat启动没异常 访问.jsp 和action失败 单独测试struts2成功 hibernate+spring成功
- spring
- 0个回答
换一换