This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting name of module from request object

 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Figured it out:

ActionMapping mapping = (ActionMapping)request.getAttribute("org.apache.struts.action.mapping.instance");
String module = mapping.getModuleConfig().getPrefix();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic