why we can't initialize a servlet using constructor itself?

Posted by Reddy on Stack Overflow See other posts from Stack Overflow or by Reddy
Published on 2010-05-27T11:24:35Z Indexed on 2010/05/27 11:31 UTC
Read the original article Hit count: 153

Filed under:
|
|
|

Why do we have to override init() method in Servlets while we can do the initialization in the constructor and have web container call the constructor passing ServletConfig reference to servlet while calling constructor?

Ofcourse container has to use reflection for this but container has to use reflection anyway to call a simple no-arg constructor

© Stack Overflow or respective owner

Related posts about java

Related posts about servlets