• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Action configuration problem in Struts 2

 
Jr Wright
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic