关于struts2中struts.xml问题。求解答。

jinxuan528 2011-07-27 10:21:13
在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标签 同样显示错误.为什么??

...全文
69 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jinxuan528 2011-07-27
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 wsatgsgasgdasgdasg 的回复:]
你修改了配置文件,你需要重新加载整个项目的。还有一种方法:你把struts2的模式,调成开发模式
[/Quote]

如何设为调为开发模式~~?
又如何重新加载整个项目。貌似重新启动服务器没用~~~
jinxuan528 2011-07-27
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 javajkjiankejk 的回复:]
当然错了访问的路径就错了,http://localhost:8080/项目名称/struts/condition.action
[/Quote]
额~~更正一下。
http://localhost:8080/biaoqian/condition.action
http://localhost:8080/biaoqian/investigate.action

写的太快没仔细看~~
scsunchen5 2011-07-27
  • 打赏
  • 举报
回复
你的路径 http://localhost:8080/investigate.action 项目名字呢。应该是http://localhost:8080/Project/investigate.action
JAVAJKjiankeJK 2011-07-27
  • 打赏
  • 举报
回复
当然错了访问的路径就错了,http://localhost:8080/项目名称/struts/condition.action
  • 打赏
  • 举报
回复
你修改了配置文件,你需要重新加载整个项目的。还有一种方法:你把struts2的模式,调成开发模式

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧