Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between Servlet and Servlet Instance

 
kashwini Kulkarni
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vishal Trivedi
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic