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
smime.p7s
Description: S/MIME Cryptographic Signature