今天本打算部署下struts2的环境当作复习,本来以往部署很顺手的,可今天总是出现There is no Action mapped for namespace [/] and action name [user_all] associated with context path [/struts2json]. - [unknown location]的错误提示信息,后来反复检查web.xml、struts.xml配置,没有错呀,仔细一想可能是我新建struts.xml文件命名的问题,因为以往我新建struts2的配置文件都是以struts.xml为命名的,今天是以user.xml命令所以出现错误,更改过后就不会出现此错误了,哎,我算是服了!
错误提示信息:
一月 12, 2016 5:38:53 下午 org.apache.struts2.dispatcher.Dispatcher warn
警告: Could not find action or result: /struts2json/user_all.action
There is no Action mapped for namespace [/] and action name [user_all] associated with context path [/struts2json]. - [unknown location]
工程结构目录:
新建struts2配置文件时,1、确保一定要以struts.xml命名大小写正确;2、struts.xml配置文件要在src目录下。