解决 struts2 报"There is no Action mapped for namespace / and action name"的问题


在配置struts2 入门demo时碰到"There is no Action mapped for namespace / and action name"问题,查了一些资料,但没有完全解决问题, 因为造成此问题的原因有很多,

比如这位博主的文章提到的https://www.cnblogs.com/GeekRegister/articles/4949441.html

我再补充几点调试过程中发现的坑:

"There is no Action mapped for namespace / and action name"问题


1. <action name="index"> 这里的"index" 不能加斜杠, 加斜杠在"http://localhost/strutsDemo/index" 路径下无法访问


2. 没有配到tomcat服务器, 项目建好后直接运行服务器, 这时服务器里没有配制新项目, 直接点项目, 右键 run as -> run on server , 解决


3. 最坑的,,, 在eclipse中的tomcat服务器中删除项目后, 在加进去,也报这个错,, 这个问题什么原因不知道, 解决办法是 删掉eclipse里配好的tomcat, 重新配

 

<struts>

    <package name="actions"  extends="struts-default">
        <action name="index">
            <result>/index.jsp</result>
        </action>
    
    </package>
    
    
  
</struts>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM