On Wed, 25 Apr 2001, Bob Jamison wrote:
> Amy Roh wrote:
>
> > Servlet spec 2.3 has changed to support init(FilterConfig config) and
> > destroy() methods instead of getFilterConfig() and
> > setFilterConfig(FilterConfig config) after discussion to change filter cycle
> > to be similar to the servlet life cycle in the expert group. The recent
> > changes will be reflected in the new Proposed Final Draft 2 (which will be
> > available to public very soon). So TC4 is up to date with the recent spec.
> > :-)
> >
> > Amy
> >
> Thanks, that's what I suspected.
>
> By the way, I did not find any examples that actually performed any
> filtering.
Inside the sources of the "examples" web app that comes with Tomcat 4.0,
there is a CompressionFilter that automatically applies GZIP compression
if the client says they can use it, and the response is over a
configurable size limit.
> Would this be a common usage pattern for Filter? :
>
Yep, you've got the pattern down. It's also legal to use
HttpServletResponseWrapper if you're wrapping HTTP responses. And, of
course, you can wrap the request if you want to do input filtering, in
pretty much the same manner.
Craig