读书人

关于struts2中struts.xml有关问题。求

发布时间: 2012-04-02 19:58:59 作者: rapoo

关于struts2中struts.xml问题。求解答。
在biaoqian工程里
<struts>
<package name="struts" extends="struts-default">
<action name="condition" class="tom.jiafei.Condtion">
<result name="success">/condition1.jsp</result>
</action>
<action name="iterator" class="chapter13.InteratorAction">
<result name="success">/iterator2.jsp</result>
</action>
<action name="investigate" class="chapter13.InvestigateAction">
<result name="success">/chapter13/investigate.jsp</result>
</action>
</package>
<struts>
前两个是先写的,编译成功 http://localhost:8080/condition.action
后一个是后来添加的 http://localhost:8080/investigate.action 显示404错误
HTTP Status 404 - There is no Action mapped for namespace / and action name investigate.

--------------------------------------------

type Status report

message There is no Action mapped for namespace / and action name investigate.

description The requested resource (There is no Action mapped for namespace / and action name investigate.) is not available.

又比如往struts.xml多添加几个package标签 同样显示错误.为什么??



[解决办法]
你修改了配置文件,你需要重新加载整个项目的。还有一种方法:你把struts2的模式,调成开发模式

读书人网 >Java Web开发

热点推荐