您当前的位置: 首页 > 

Gutie_bartholomew

暂无认证

  • 3浏览

    0关注

    378博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

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

Gutie_bartholomew 发布时间:2018-10-02 17:59:43 ,浏览量:3

也许许多人用Struts时一开始会碰到这个错误

There is no Action mapped for namespace [/] and action name [user!list] associated with context path [/PoiDemo2]. - [unknown location]

对于与上下文路径[/ PoiDemo2]相关联的命名空间[/]和操作名称[user!list]没有映射的操作。 - [未知位置]

从网上查看了各种资料,总结起来一般来说有以下几个问题造成

1、struts.xml的名字

struts.xml是struts2的默认配置名字,不要写成其他的如struts2.xml。

2、struts.xml的位置

要确保struts.xml文件在src目录下(好像不一定,不过要编译成功后,确认编译到classes目录中)。

3、如果是动态项目一定要在strurs.xml中加入

,或者将ture改成false,如果没有,还是会报错。

如下:

4、struts.xml内容

使用默认命名空间就够了.

 5、web.xml中的 

    helloWorld.jsp  

一定要和helloWorld.jsp相对应

参考:

https://blog.csdn.net/qq_21004057/article/details/79252151

关注
打赏
1662709650
查看更多评论
立即登录/注册

微信扫码登录

0.2393s