There is no Action mapped for namespace [/] and action name [] associated with context path [/JWTest

      网页显示There is no Action mapped for namespace [/] and action name [] associated with context path [/JWTest问题的原因有很多种,我在看了网上发现和我的情况不一样。

      最后发现我的情况是:1.我的struts项目主页是Login.jsp,而不是index.jsp。默认情况下,程序会找到index.jsp。如果你没有index.jsp在你的[/]目录中,则会发生该错误。或者你必须选择文件web.xml修改,修改方法是在你的web.xml的filter-mapping下添加这个代码:

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

        2.我struts.xml的代码中有多个package:

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

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

然后我将第二个package的namespace改为/user2就成功了

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

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



                    


猜你喜欢

转载自blog.csdn.net/adnap7/article/details/80411820