• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mechanism of init method to initialize servlet

 
abhijeet srivastava
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65128
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also covered in the Servlets FAQ.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic