aspose file tools*
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 Spring in Action 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
Author

Action configuration problem in Struts 2

Jr Wright
Greenhorn

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">earningsAlerts.page</result>
</action>

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
Sheriff

Joined: Aug 03, 2008
Posts: 9304
    
  17

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

${pageContext.request.contextPath}/runFinancialAlerts.action


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Action configuration problem in Struts 2