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 Mechanism of init method to initialize servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Mechanism of init method to initialize servlet" Watch "Mechanism of init method to initialize servlet" New topic
Author

Mechanism of init method to initialize servlet

abhijeet srivastava
Greenhorn

Joined: Aug 22, 2006
Posts: 26
Hi all!

I have some doubts about init method in servlet initialization.

1. if init method is not overridden the which version of init method is called by Container?
init() or init(ServletConfig)

2. when init() version of init method is overridden then how Container get ServletConfig object for that servlet?

Thaks...
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by abhijeet srivastava:
1. if init method is not overridden the which version of init method is called by Container?
init() or init(ServletConfig)


Read the docs.


2. when init() version of init method is overridden then how Container get ServletConfig object for that servlet?


docs.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56529
    
  14

Also covered in the Servlets FAQ.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mechanism of init method to initialize servlet
 
Similar Threads
why super.init() is used??
Servlet init method
init() method in a Servlet's lifecycle.
Overriding both versions of init() method
init() vs constructor