There is no Action mapped for namespace / and action name “yourActionName”
Problem
Many Struts 2 developers are claimed that they had configured the action class properly but hits the actions error message while accessing the action class.
See error message in two modes :
1. “struts.devMode” is turn off (default)
HTTP Status 404 - There is no Action mapped for namespace / and action name "yourActionName". type Status report message There is no Action mapped for namespace / and action name "yourActionName". description The requested resource (There is no Action mapped for namespace / and action name "yourActionName".) is not available.
2. struts.devMode is turn on
In struts.xml
<constant name="struts.devMode" value="true" />Struts Problem Report
Struts has detected an unhandled exception:
Messages:
There is no Action mapped for namespace / and action name "yourActionName".
Stacktraces
There is no Action mapped for namespace / and action name "yourActionName". - [unknown location]
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:178)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
...
You are seeing this page because development mode is enabled. Development mode, or devMode,
enables extra debugging behaviors and reports to assist developers. To disable this mode, set:
struts.devMode=false
in your WEB-INF/classes/struts.properties file.Solution
The above error message is saying that the action class is not available, it means you are did something wrong in your action class configuration, may be it’s a namespace or typo error, just double check the name.
Here’s a working action class configuration in struts.xml file, may use for your reference.
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.devMode" value="true" /> <package name="default" namespace="/" extends="struts-default"> <action name="abcAction" class="com.mkyong.common.action.AbcAction" > <result name="success">pages/abc.jsp</result> </action> </package> </struts>
Assume the project root context is “Struts2Example“, so, you can access the above action via this URL –
http://localhost:8080/Struts2Example/abcAction.action






I got the error message when used Struts 2.2.3 annotations, for Struts 2.1, it’s just fine.
Hi all
I tried all the possible ways given here but this doesnot seems to be helpful for me. I am using Eclipse EE, so can anyone tell where to put this struts.xml file.
am tired of struts2 but it provided me right solution.I love this article.I recommend this article to my friends
[...] There is no Action mapped for namespace / and action name “yourActionName” [...]
“There is no Action mapped for namespace / and action name “yourActionName”.”
Please note, that Struts 2 has a different place for the struts.XML file!
Under WEB-INF/classes instead of WEB-INF.
Thanx for that undocumented or darkly commented change :-).
The message you get is the one above, instead of the rather logical “cannot load struts.XML file. Is it in WEB-INF/classes?”
thanks a lot for your valuable key point.
This might be as simple as addiing a “/” infront of the action name as below.
<a href="" > VEGGIEor
This could fix the “There is no Action mapped for namespace” error
This might be as simple as addiing a “/” infront of the action name as below.
action=”/fileUploadAction”
in your form
Thanx roland…. your point solved my problem….
Thanx alot.
Thank buddy..
nice article..