java ee - Abort application loading when exception in ServletContextListener -


is there container independent way abort application loading process when fail in servletcontextlistener#contextinitialized

if there more 1 application deployed on server, other applications should not affected.

why java ee not specify standard way that?

you can throw unchecked exception in listener. spec:

some exceptions not occur under call stack of component in application. example of sessionlistener receives notification session has timed out , throws unhandled exception, or of servletcontextlistener throws unhandled exception during notification of servlet context initialization, or of servletrequestlistener throws unhandled exception during notification of initialization or destruction of request object. in case, developer has no opportunity handle exception.

the container may respond subsequent requests web application http status code 500 indicate application error. developers wishing normal processing occur after listener generates exception must handle own exceptions within notification methods.

what means if throw, say, unsupportedoperationexception listener (or listener really), stop application being put service. container respond http-500 (to can map error page)


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -