Hello Tomcat users,

I wanted desperately to get better error page for a web application that is
stopped using manager application. It turned out to be far more easier than
I was afraid of.

All that is needed is valve that does following in it's invoke method:

Context context = (Context)getContainer().map( request, true );

if( context.getAvailable() ){
    valveContext.invokeNext( request, response );
} else {
    // this context is not available at the moment so let's redirect to a
desired page
    HttpServletResponse hres = (HttpServletResponse)response.getResponse();
    hres.sendRedirect( "/message/not-available.jsp" );
}

Is there a better way of doing it? If you are more familiar with tomcat can
you
estimate how costly it is to perform this kind of check before every
request?

with best wishes,
Taavi



--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to