• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on Servlet spec 2.3.3

 
Suvrat Joshi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The Request Handling section of the Servlet spec (2.3.3) states
"Note that a servlet instance placed into service by a servlet container may handle no requests during its lifetime."
Does this mean that once the servlet is instantiated, initialized and has accepted a request, it cannot handle anymore requests?
What is the definition of lifetime in the context of a servlet?
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The keyword in that statement is "may". A servlet can be loaded and actually never handle any requests. No, it does not mean that it cannot handle any requests. Lifetime means after the init methos of the servlet is called and before the destroy (the servlet gets unloaded) method is called.
------------------
Bosun
SCJP for the Java� 2 Platform
 
Suvrat Joshi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response. The "may" definitely is key in the statement and I misread the statement. Thanks for the clarification.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, English sucks.

In grade 3, I had an English (from the country England I mean) teacher who would be completely un-forgiving if we asked "Can I go to the bathroom?"

His reply would be, "I don't know, CAN you?"

Point being, the use of the word 'may' is somewhat ambiguous, even in context.

"you may handle the request" -> yes, i give you permission to handle the request.
"you may handle the request" -> you might handle a request, or you might not.

You should write the servlet-spec author, and suggest a change of wording (change 'may handle no request' to 'might not handle a request').
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same post in two forums Suvrat? ...anyway i already tried to answer it here --- http://www.javaranch.com/ubb/Forum18/HTML/000592.html
Tell me whtether u agree or not and any more options?...
------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!