aspose file tools
The moose likes Servlets and the fly likes Methods of creating Servlet instance? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Methods of creating Servlet instance?" Watch "Methods of creating Servlet instance?" New topic

Methods of creating Servlet instance?

Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
Hi guys,
In how many ways one can create instance of Servlets?.
For e.g.
One method is to create instance in init() method, so when ever the server loads, a servlet instance will create.
I think there must be more methods.May be there is a method which creates instances when ever 1st request is made by client.

Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
You don't create a servlet instance. The server creates the servlet instance. The init method does not create your servlet instance -- instead it is called after it is created.
The instance is created by the framework in one of two ways, either on web container startup (as indicated by the "load-on-startup" tag) or upon first invocation by a client.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Don't get me started about those stupid light bulbs.
subject: Methods of creating Servlet instance?