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 Servlets and the fly likes getServletConfig() and getServletContext() 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 » Java » Servlets
Bookmark "getServletConfig() and getServletContext()" Watch "getServletConfig() and getServletContext()" New topic

getServletConfig() and getServletContext()

jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266

In the servlet code I have :


how can we invoke getServletConfig() just like that ?? Does every servlet inherit a getServletConfig() method ???

Also in case of <context-param> i have in servlet code :


how can we invoke getServletContext() just like that ??
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 61092

Did you check the Javadocs for your answer?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Brij Garg
Ranch Hand

Joined: Apr 29, 2008
Posts: 234
Please check Servlet, ServletConfig, ServletContext interface and GenericServlet class in JAVA API
I agree. Here's the link:
subject: getServletConfig() and getServletContext()