You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Kevin Jones <kj...@develop.com> on 2003/06/12 23:05:15 UTC

Filters

Hi,

I'm using Cactus to test a filter. 
The filter is mapped to /*
I'm calling the filter inside a FilterTestCase like this

MyFilter filter = new MyFilter();
filter.init(filterConfig);
filter.doFilter(...);


I'm seeing the doFilter called twice, I assume this is because the
filter is mapped to /* and the cactus request is firing the filter. This
must be a common problem and I was wondering what if anything is the
work around?

Thanks

Kevin Jones


RE: Filters

Posted by Kevin Jones <kj...@develop.com>.
Hi Vincent,

> Hmm... Why do you have a filter mapping for the test? Is it because >
you
> also want to test the mapping? My recommendation would be to remove your
> filter mapping and only keep the Cactus FilterRedirector one.
> 

Because I'm using the same (more or less) web.xml for testing and
release - I'll fix the web.xml using Ant's filter's and try it again,

Kevin



RE: Filters

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Kevin Jones [mailto:kjones@develop.com]
> Sent: 12 June 2003 23:05
> To: cactus-user@jakarta.apache.org
> Subject: Filters
> 
> Hi,
> 
> I'm using Cactus to test a filter.
> The filter is mapped to /*
> I'm calling the filter inside a FilterTestCase like this
> 
> MyFilter filter = new MyFilter();
> filter.init(filterConfig);
> filter.doFilter(...);
> 
> 
> I'm seeing the doFilter called twice, I assume this is because the
> filter is mapped to /* and the cactus request is firing the filter.
This
> must be a common problem and I was wondering what if anything is the
> work around?

Hmm... Why do you have a filter mapping for the test? Is it because you
also want to test the mapping? My recommendation would be to remove your
filter mapping and only keep the Cactus FilterRedirector one.

-Vincent

> 
> Thanks
> 
> Kevin Jones
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org