This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes finding action-mapping given the action name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "finding action-mapping given the action name" Watch "finding action-mapping given the action name" New topic
Author

finding action-mapping given the action name

jonathan Greens
Ranch Hand

Joined: Apr 07, 2004
Posts: 139
Is there any class in struts that will convert an action path and look it up in struts-config and find the corresponding forward?
for example, I have the following action-mapping:
<action path="/viewReportSetup" type="com.xxx.ViewReportSetupAction">
<forward name="success" path="/assessment/ReportSetup.jsp"/>
<forward name="failure" path="/assessment/ReportSetup.jsp"/>
</action>

I want to be able to find the corresponding ActionForward given the string "viewReportSetup.do", can this be done?
I found ConfigHelper class, i am not sure if it's the right class to use, and it requires PageContext to be passed it as an argument to the constructor. The available objects i have access to are HttpServletRequest request, HttpServletResponse response.
thanks in advance.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

You might find it easier to simply use global forwards to achieve your objective.


A good workman is known by his tools.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: finding action-mapping given the action name
 
jQuery in Action, 3rd edition