File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Action configuration problem in Struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Action configuration problem in Struts 2" Watch "Action configuration problem in Struts 2" New topic

Action configuration problem in Struts 2

Jr Wright

Joined: Feb 19, 2009
Posts: 4
I'm getting this error message when running a JSP in struts 2. The struts.xml file is in the correct place, /src:

There is no Action mapped for namespace /jsp/my-app/screenscrape and action name runFinancialAlerts. - [unknown location]

My action configuration in my struts.xml looks like this:

<action name="runFinancialAlerts" class="com.bizbuz.myApp3.web.actions.FinaAlertsAction">
<result type="tiles"></result>

The name space shown in the error message is the directory where the jsp that runs the action is located.

Thank you, sky
Ankit Garg

Joined: Aug 03, 2008
Posts: 9452

You must be directly accessing the JSP and the URL to the Struts action must be relative. This is why the generated request is for /jsp/my-app/screenscrape/runFinancialAlerts. Without looking at your JSP code its hard to know the fix, but generally a path relative to the root with the context path added in the beginning should do it, something like this


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: Action configuration problem in Struts 2
It's not a secret anymore!