File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Getting name of module from request object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
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: 4727

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: 4727

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://aspose.com/file-tools
 
subject: Getting name of module from request object