• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Usage of Servlet instance

 
Vikrama Sanjeeva
Ranch Hand
Posts: 760
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Servlet Spec.2.3

For a servlet not hosted in a distributed environment (the default), the servlet container must use only one instance per servlet declaration

Why it is using MUST?.I think we can have pool of instances per servlet declaration.
Bye.
Viki.
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a spec and as a container provider you must obey it. Do You want to have your pool of servlets go ahead u r not a container provider
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While I don't know the philosophy behind this but if I were to make an educated guess, I would say this restriction is placed inorder to enforce the multi-thread principles of Servlets. Have only ONE instance and create a seperate thread for each request.
- satya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic