tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Nakamura <>
Subject Filters and HttpServletResponse.close();
Date Thu, 07 Feb 2002 04:59:13 GMT

When does the HttpServletResponse object get closed if the servlet doGet()
method doesn't call HttpServletResponse.close() explicitly?
For example, suppose a servlet filter creates a HttpServletResponseWrapper
to wrap the initial HttpServletResponse and passes on this new response
object down the doFilter() chain.  The servlet doGet() method eventually
gets called, but doesn't explicitly call close() of the wrapped
response object.  After tomcat returns from the container's invoke() method,
it calls finishResponse() which is supposed to flush and close the response
object, but isn't this the original response object?  What about the
wrapped response object created by the filter?  It appears it never gets
closed and is not flushed properly.  I think this explains why I'm not
getting any output from my filter when doGet() doesn't explicitly call
HttpServletResponse.close().  Did I miss something?

- Glen Nakamura

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message