Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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

Win a copy of The Software Craftsman this week in the Agile forum!
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: 62298

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] [Bear's FrontMan] [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
Have you tried LearnNowOnline?
subject: servlet object creation