wood burning stoves
The moose likes Servlets and the fly likes Filters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Filters" Watch "Filters" New topic
Author

Filters

Sondra Colagrossi
Ranch Hand

Joined: Oct 30, 2002
Posts: 68
I been shopping in the pet store and I'm confused about how the FilterChain gets setup.
The following element is from the 2.3 DTD.
<!ELEMENT filter-mapping (filter-name, (url-pattern | servlet-name))>
So if I have the following in my deployment descriptor:
<filter-mapping>
<filter-name> filter_1 </filter-name>
<servlet-name> myServlet </servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name> filter_2 </filter-name>
<servlet-name> myServlet </servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name> filter_3 </filter-name>
<servlet-name> myServlet </servlet-name>
</filter-mapping>
I can expect the container to setup the FilterChain of filter_1, filter_2, filter_3.
The FilterChain.doFilter( req, res ) is a call from filter to filter?
[ December 17, 2002: Message edited by: Bob Fred ]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi Bob,
Your assumption is correct: the container will setup the filter chaining for you.
However, you will need to indicate (in your filter code) when this chaining occurs. This is where you will have to call the chain.doFilter (request, response) method.
Cheers
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Filters
 
It's not a secret anymore!