tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Dalquist <>
Subject Missing Context error text
Date Mon, 12 May 2008 17:08:44 GMT
Is it expected that when attempting a cross-context dispatch to a 
missing context that error text is written to the PrintWriter of the 
underlying HttpServletResponse?

I wrap the response before the dispatch with an extension of 
HttpServletResponseWrapper which redirects all content (PrintWriter or 
ServletOutputStream) to a buffer for later use. This works correctly if 
the context being dispatched to exists, all content written out by the 
call ends up in my buffer. If the context doesn't exist Tomcat writes 
out an error message to the PrintWriter of the wrapped 
HttpServletResponse which results in the message like "The requested 
resource (/MyContext/MyServlet) is not available" appearing in my 
rendered page where I don't want it.

Is this behavior, writing to the underlying response object, dictated by 
the spec? Is this required of Tomcat versus writing to the PrintWriter 
provided by the response wrapper.

Thank you,
-Eric Dalquist

View raw message