Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

access to the context path w/in Action class

 
J. Cartwright
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

is there a way to access the context path w/in the Action class? I'd like the equivilent of the the JSP tag:

<html:rewrite page=""/>

Thanks!

-- john
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To get the context path:

String path = request.getContextPath();

To perform URL rewriting:

String newURL = response.encodeUrl(oldUrl);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic