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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Difference between Servlet and Servlet Instance" Watch "Difference between Servlet and Servlet Instance" New topic
Author

Difference between Servlet and Servlet Instance

kashwini Kulkarni
Ranch Hand

Joined: Aug 07, 2009
Posts: 63
Hello ,

I have a very basic question regarding servlet , (which keeps me confusing)

What is the difference between Servlet and Servlet Instance?

I surfed the internet and found the following : -

" The init() method is called once per servlet instance. "


" There are no concurrency issues during servlet initialization, because the server calls the init method once, when it loads the servlet. "

which appear confusing to me.

Can anyone please explain me or let me know some site that has in-depth explanation about servlet life cycle?




Thanks in Advance
Kashwini





Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60048
    
  65

There's no difference really. "The servlet" isn't an exact term -- it could mean a servlet instance, or it could mean the servlet class.

Whenever mention is made of a loaded and running servlet, it's a servlet instance that is meant.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vishal Trivedi
Ranch Hand

Joined: Sep 05, 2011
Posts: 57
A servlet depending on the context where it is used may be a class or an instance as well.And instance as you have mentioned the serlet class that has peen processed to initialization.....
 
wood burning stoves
 
subject: Difference between Servlet and Servlet Instance
 
Similar Threads
doubt in servlet init method
what's the benefit to add "synchronized" before "init" method?
What values initialized in servlet
What values initialized inside init() in servlet
init() vs. static {}