This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes ServletContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "ServletContext" Watch "ServletContext" New topic
Author

ServletContext

Abir Majumder
Greenhorn

Joined: Dec 06, 2008
Posts: 3
Hi
Is it possible to get ServletContext from HttpServletRequest?
thanks
Peter Purmonen
Greenhorn

Joined: Oct 24, 2008
Posts: 9
Yes, via request.getSession(true).getServletContext(), assuming the code executes within a servlet context.
Abir Majumder
Greenhorn

Joined: Dec 06, 2008
Posts: 3
thanks peter. I checked HttpSession api. That method is there. Please clarify.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

"Abir", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServletContext