I'm trying to get up to speed with the Servlet 3.0 specification --
specifically asynchronous requests vs. all my existing filters, etc.
I have an existing response compression filter. Yes, I know Tomcat's
HTTP connector can do this, but our filter has some special features,
works with the AJP connector (which we use), and works with other
servlet engines besides Tomcat.
Part of the existing logic is:
final GzippingResponse gzippingResponse = new GzippingResponse(
origHttpRequest, origHttpResponse );
try
{
filterChain.doFilter( origRequest, gzippingResponse );
gzippingResponse.finish();
}
finally
{
gzippingResponse.end();
}
where finish() calls ServletResponse.flushBuffer() and
GZIPOutputStream.finish() and end() calls Deflator.end() to do timely
release of resources.
My issue here is how can I ensure that gzippingResponse.finish() is
called prior to the response stream being closed but after all calls
writes to the response? AsyncContext.complete() sounds like it closes
the output streams/sockets and *then* calls the completion listeners.
Is this simply a misunderstanding on my part or is there some other
means for a filter to interject itself between the final write to a
response and stream/socket closure?
--
Jess Holle
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org