This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting contextpath without request  RSS feed

 
Robert Willems
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
is there a way to get the contextpath a webapplication is configured to without a request? You configure your app-server with that path before getting requests....
In other words can is there anyway i can get the contextpath with only a javax.servlet.http.HttpServlet object?
Thanks in advance...
Regards,
Robert Willems
 
Brahim Bakayoko
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the getServletContextName() of the ServletContext which you get from the ServletConfig object passed to you in the init() method.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!