lightbulb432 wrote:
Can requests potentially arrive at a servlet before the
ServletContextListener's contextInitialized method has completed? I ask
because the method occurs as a notification once the servlet context is
ready to accept requests. Is there a chance, then, that a request could
begin being served while your contextInitialized method is being carried out
(especially if it's long-running)?

Is contextInitialized suitable only for things like logging the fact that a
context is ready, or can it be used for setup that MUST occur before the
first request is accepted? If not the latter, what can be used to serve this
function?

The spec says:

"All ServletContextListeners are notified of context initialization before any filter or servlet in the web application is initialized. "

Depends on what they do to know if they complete before servlets are started.


p

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to