aspose file tools*
The moose likes Servlets and the fly likes Is Servlet Singelton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Is Servlet Singelton" Watch "Is Servlet Singelton" New topic
Author

Is Servlet Singelton

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
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

Joined: Mar 22, 2000
Posts: 12683
    
    5
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


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is Servlet Singelton
 
Similar Threads
Modified singelton pattern
singleton class
Which is Better approach for defining resource bundle object as member or static
Singleton Question
Multi-threaded servlet