This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one 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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 61092
    
  66

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creation of 5 object instances dynamically for a servlet