This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes creation of  5 object instances dynamically for a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "creation of  5 object instances dynamically for a servlet" Watch "creation of  5 object instances dynamically for a servlet" New topic
Author

creation of 5 object instances dynamically for a servlet

raghuram bikkani
Greenhorn

Joined: Jan 18, 2006
Posts: 16
how we create 5 object instances dynamically for a servlet?suppose if creation is possible dynamically, i make a request to that servlet which object instance will give to me?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

Unless you use a deprecated setting, there will be only one instance of a servlet per servlet declaration.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
I doubt about deprecated api. Servlet specification has deprecated just SingleThreaded class. Loading multiple instance is fine as long as synchronization is take care in the servlet. Setting the number of servlet to be loaded is specific to application server. For eg: WebLogic has something like single-threaded-servlet-pool-size. Correct me if I am wrong.
 
Don't get me started about those stupid light bulbs.
 
subject: creation of 5 object instances dynamically for a servlet
 
Similar Threads
Servlet Object in Servlet Class
Thread or Runnable
Multiple instances and multiple threads
class.newInstance() Vs object.clone()
Sharing Connection Object