The Request Handling section of the Servlet spec says "Note that a servlet instance placed into service by a servlet container may handle no requests during its lifetime"... What does this mean?
Asked
Active
Viewed 41 times
1
-
I just stumbled over this strangely worded line also. I think it is supposed to mean that it is not guaranteed (e.g. by the servlet lifecycle) that a servlet will handle any requests at all during its lifetime. It might never be called. Therefore it is important not to place any initialization logic into the service() method of the servlet, as it might not be executed. – Florian Wicher Dec 31 '21 at 18:05
1 Answers
1
If a url is mapped to a servlet, the url may never be requested, and therefore the servlet would not handle any requests during its lifetime.

7stud
- 46,922
- 14
- 101
- 127