• Post Reply Bookmark Topic Watch Topic
  • New Topic

ServletContext  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Is it possible to get ServletContext from HttpServletRequest?
thanks
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, via request.getSession(true).getServletContext(), assuming the code executes within a servlet context.
 
Abir Majumder
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks peter. I checked HttpSession api. That method is there. Please clarify.
 
Author and ninkuma
Marshal
Posts: 66690
167
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Abir", please check your private messages for an important administrative matter.
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!