This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!