This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes doubt about servlet context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "doubt about servlet context" Watch "doubt about servlet context" New topic

doubt about servlet context


Joined: Mar 28, 2005
Posts: 23
Can anyone please tell how retrieve servlet context object?
Sergey Tyulkin
Ranch Hand

Joined: May 10, 2005
Posts: 87
You can retrieve ServletContext object by ServletConfig.getServletContext() method.
The ServletConfig object is passed to the init() method of the servlet.
More over, GenericServlet itself implements ServletConfig interface, and you can simply cal getServletContext() method as is in you servlet methods (doGet, doPost an so on)

Joined: Mar 28, 2005
Posts: 23
Thank you
I agree. Here's the link:
subject: doubt about servlet context
Similar Threads
application context and servlet context
servlet context,page context and application context
How a servlet of one Context communicate with other servlet of different context
servlet config
AC and SC