File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes servletconfig and servletcntext 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 "servletconfig and servletcntext" Watch "servletconfig and servletcntext" New topic
Author

servletconfig and servletcntext

abhinav rajput
Greenhorn

Joined: Feb 23, 2012
Posts: 4
what is the main purpose of these things in a servlet. I really dont understand.
Why should we overrite init(). does container dont call init()
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
what is the main purpose of these things in a servlet. I really dont understand.

Give it a shot and try to explain to us what you did understand. The javadocs of ServletContext in particular go to some length explaining what it does. Ask yourself this: If you didn't have the methods in those classes, how would you go about doing the things they do?

Why should we overrite init(). does container dont call init()

You need to differentiate between Servlet.init(ServletConfig) and GenericServlet.init(). I suggest to read their respective javadocs; that should make things clearer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servletconfig and servletcntext