美文网首页
Struts2中关于"There is no Acti

Struts2中关于"There is no Acti

作者: _karen | 来源:发表于2017-05-09 11:38 被阅读73次

第一次写这种文章,还是蛮紧张的,昨天运行项目的时候,遇到了以下问题,今天上午才解决,之前很少自己动手解决问题,所以还是蛮开心的,记录一下,也可以同时给遇到同样问题的小伙伴提供下解决思路~
环境:intellij idea + Tomact
框架:struts2
编译后运行遇到问题
"There is no Action mapped for namespace / and action name"
在网上查阅了一些资料之后,发现会导致以上报错的解决方案有几个:
1.拼写(没错,就是拼写)
struts.xml
2.文件路径

  • 未编译的struts.xml应该放在src下
图片.png
  • 编译后的struts.xml应该放在WEB-INF的class下,如下:

3.src下,struts.xmlpackage中应该配置一个namespace,

<package name="default" namespace="/" extends="struts-default">

4.web.xml中的主页配置错误

<welcome-file-list>
    <welcome-file>home.jsp</welcome-file>
</welcome-file-list>

5.或者是struts.xml中配置文件的大小写有问题(我就犯了这个2的错--囧)

相关文章

网友评论

      本文标题:Struts2中关于"There is no Acti

      本文链接:https://www.haomeiwen.com/subject/zepbtxtx.html