• Post Reply Bookmark Topic Watch Topic
  • New Topic

How many servlet instance will be created?  RSS feed

 
walter wang
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)If same web client requests same Servlet service two times. then how many instances of Servlet objects will be created?
2) If 2 different Web clients request same Servlet
service ,then how many instances of Servlet objects will be created?
3) Is servlet container smart enough to distinguish different web client?
 
Thomas Smets
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1)If same web client requests same Servlet service two times. then how many instances of Servlet objects will be created?

If it does simultaneously (the request), it depends your Servlet. Servlets can be made in Single-Threaded Model, hence ... On Servlet at the time

2) If 2 different Web clients request same Servlet
service ,then how many instances of Servlet objects will be created?

See above !
No Single-Threaded Model, then the two requests are server in parrallel (multithreading, not two CPU's).

3) Is servlet container smart enough to distinguish different web client?

Look at the Session Object
The Servlet Container (implementor) were (are) smart enough to allow it !

Thomas SMETS,
SCJP- Brussels
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!