File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes servlet object creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet object creation" Watch "servlet object creation" New topic

servlet object creation

krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158

the process inside a container is one servlet-multiple threads(requests), that is no matter how many requests are made,only one servlet object is created. does this applies to all classes, such as servlets generated from a jsp, models(POJC,EJB), that we use in our web application.

have a nice day
krishna prasad

have a great day,
krishna prasad
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

No, servlets created by the container follow the rules that the container applies. Objects that you create in your own code follow the rules that you apply.

[Asking smart questions] [About Bear] [Books by Bear]
krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
i have a servlet which is called upon by a request. servlet creates an object of a model that interacts with the database. so number of Model objects created is equal to the number of requests received, but the servelt is one and only one. is that right?
Ben Souther

Joined: Dec 11, 2004
Posts: 13410


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: servlet object creation
jQuery in Action, 3rd edition