hello friends,
I would like to know the exact reason for why a servlet
doesnot have a constructor , the reason given in the
book is not satisfactory.
thanks in advance
regards
- mohan
-
servlet constructor (2 messages)
- Posted by: mohan ramanna
- Posted on: September 22 2000 07:56 EDT
Threaded Messages (2)
- servlet constructor by Subrahmanyam Allamaraju on September 22 2000 11:37 EDT
- servlet constructor by Christopher Fowler on October 24 2000 09:50 EDT
-
servlet constructor[ Go to top ]
- Posted by: Subrahmanyam Allamaraju
- Posted on: September 22 2000 11:37 EDT
- in response to mohan ramanna
A servlet is a container managed object. Since the life cycle is managed, the constructor is not very useful to initialize a servlet. Instead, you use the init() method to do any initialization.
The difference is that servlet construction and servlet initialization are not the same (object lifecycle vs servlet lifecycle). -
servlet constructor[ Go to top ]
- Posted by: Christopher Fowler
- Posted on: October 24 2000 09:50 EDT
- in response to Subrahmanyam Allamaraju
So it is intentional that servlets don't use constructors!!!!I've been trying to get mine to work for months. Now I feel silly. So my next question is can you overload the init() method?