tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Filter entire site?
Date Wed, 07 Nov 2001 23:56:41 GMT

On Wed, 7 Nov 2001, Sean Cooper wrote:

> Date: Wed, 7 Nov 2001 16:25:24 -0500
> From: Sean Cooper <>
> Reply-To: Tomcat Users List <>,
>      Sean Cooper <>
> To:
> Subject: Filter entire site?
> I am trying to filter an entire server through a logging process to do
> some intelligent logging.. but I have been unable to get my filter to
> process anything other then the directory that the filter class is
> sitting in...
> the filter-mapping, url-pattern is set as '/*' but it refuses to
> filter anything outside of its directory structure... and setting it
> to '*' flags an error when it tries to load the class complaining
> about a char buffer problem...
> Is this a security restriction?  Configuration problem?  API
> restriction?  ???
> Or did I miss something along the way?

Filters only see requests for the web application in which they are
defined -- they don't see requests to other web applications.  The URL
patterns for filter mappings (and for servlet mappings, for that matter)
are relative to the context root.

If you really wanted to write some code that saw all requests, you'd need
to use server-specific facilities (such as implementing a Valve in Tomcat
4).  In fact, the existing access logs are created by a Valve that does
just this kind of trick (see all requests to the entire server) because it
is registered just inside the <Engine> element in server.xml.

> thanks,
> -Sean


To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message