Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is Servlet Singelton

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
1) I would like to know if Servlet is designed to implement Singelton . In other words
Can there be more than one instance of a servlet at one time ?

Rgrds
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In normal operation, the sevlet container (ie Tomcat) only creates a single instance of a servlet. You can have multiple instances of a servlet if you create different definitions in web.xml for a given web application OR if you use the same servlet in different web applications.
If you are seriously interested in programming with servlets you should download the authoritative API documentation from Sun. Last time I looked that is
available here.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic