This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Getting name of module from request object Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Getting name of module from request object" Watch "Getting name of module from request object" New topic
Author

Getting name of module from request object

Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4725

Assuming the best object I have to work with is request, can anyone think of a way to retrieve the name of the Struts module associated with the request?


A good workman is known by his tools.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4725

Figured it out:

ActionMapping mapping = (ActionMapping)request.getAttribute("org.apache.struts.action.mapping.instance");
String module = mapping.getModuleConfig().getPrefix();
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Getting name of module from request object
 
Similar Threads
PageContext methods in EL?
Setting the value in <s:textfield from request scope
Java SE6 client for EJB - Error in lookup
JSP & useBean
Obtaining "put" values from Tiles.