You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Donie Kelly <do...@tecnomen.ie> on 2001/12/21 16:16:34 UTC

How to write a filter in Tomcat 4

Hi all

Can anybody give me a template for a filer which reads and writes to/from
the servlet being filtered.

I'm having a problem where reads are being blocked. Must be something to do
with content length, I'm not sure.

Basically, it's the last day before Christmas and it doesn't work so if
somebody has some working filter example It'd make my Christmas and allow me
to get outta here tonight....

Thanks very much
Donie

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: How to write a filter in Tomcat 4

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 21 Dec 2001, Donie Kelly wrote:

> Date: Fri, 21 Dec 2001 15:16:34 -0000
> From: Donie Kelly <do...@tecnomen.ie>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: 'Tomcat Users List' <to...@jakarta.apache.org>
> Subject: How to write a filter in Tomcat 4
>
> Hi all
>
> Can anybody give me a template for a filer which reads and writes to/from
> the servlet being filtered.
>
> I'm having a problem where reads are being blocked. Must be something to do
> with content length, I'm not sure.
>

There's a Filter example included with the Tomcat 4 distribution that
might give you some hints - it does on-the-fly GZIP compression if your
browser tells the server that it supports this, and passes the request on
unmodified otherwise.

Source code is in the "webapps/examples/WEB-INF/classes/compressionFilters"
directory in the Tomcat binary distribution.  It's not enabled by default,
but you can uncomment the appropriate stuff in web.xml to play with it.

> Basically, it's the last day before Christmas and it doesn't work so if
> somebody has some working filter example It'd make my Christmas and allow me
> to get outta here tonight....
>
> Thanks very much
> Donie
>

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>