Under which of the following circumstances are servlets most likely to be instantiated?
-
During web application startup
-
If there are insufficient instances of the servlet to service incoming requests
-
On a client first requesting the servlet
-
At the same time as a different servlet is instantiated, when that different servlet makes use of the servlet in question
-
After the time specified on an UnavailableException has expired
-
At some arbitrary point in the web application or application server lifetime
Servlets are instantiated during web application startup when configured with load-on-startup (A). They are also created on the first client request to that servlet if not already initialized (lazy initialization). After an UnavailableException expires, the servlet becomes available and may be instantiated (E). Option F, while vaguely worded, reflects that containers manage servlet lifecycle dynamically - they can create instances based on demand, configuration, or internal optimization at various points in the application lifetime. Option B is incorrect because containers manage instance pooling automatically, not by creating new ones on demand. Option D is incorrect because servlet instantiation is not triggered by other servlets being instantiated.