Bookmark Topic Watch Topic
  • New Topic

when the container instatiates the servlet will it

 
sushindranath k
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Report post to moderator
well,i want to know that when the container instatiates the servlet will it
calls a default constructor and if so of which
class constructor will it call is it HttpServlet/GenericServlet.

Regards
sushi
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
You're concentrating on the wrong thing. I don't think I have ever created a constructor for a servlet, or even worried about it.

The container instanitates the servlet, you don't worry about this.
The container initialises the servlet - this is where you come in.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
I would say three constructors ?

GenericServlet -> HttpServlet -> MyServlet

[EDIT]

I don't think I have ever created a constructor for a servlet, or even worried about it.


I agree. You could use the init method instead to instantiate whatever you want.
[ December 14, 2006: Message edited by: John Meyers ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not ask the same question more than once. I am closing this instance of the topic.
 
    Bookmark Topic Watch Topic
  • New Topic