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

前端之家收集整理的这篇文章主要介绍了There is no Action mapped for namespace [/] and action name [updateUser] associated with context path [].前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

在使用Struts2的时候,遇到了这个问题. 

原因分析: 找不到指定的路径,那么就是struts.xml的内容问题,或者是struts.xml的文件位置存在问题. 

struts2默认是应该放在src根目录下的,可是由于SSH整合,配置文件太多,所以放在了src的config/struts2/struts.xml里面

 

解决方法: 人工指定struts配置文件的位置:通过在web.xml的过滤器配置中添加初始化参数

分享图片

 <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
        <init-param> <param-name>config</param-name> <param-value>struts-default.xml,struts-plugin.xml,config/struts2/struts.xml</param-value> </init-param>
</filter>

猜你在找的XML相关文章