wood burning stoves 2.0*
The moose likes Servlets and the fly likes Filter Chain: Standard Filter Strategy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Filter Chain: Standard Filter Strategy" Watch "Filter Chain: Standard Filter Strategy" New topic
Author

Filter Chain: Standard Filter Strategy

Glenio Alexandre Nogueira
Greenhorn

Joined: Dec 02, 2004
Posts: 4
Hi folks,
I�m trying to use this configuration in my web.xml (Tomcat), but it doesn�t work. Could you help me, please?

.
.
.
<filter>
<filter-name>FilterOne</filter-name>
<display-name>FilterOne</display-name>
<description></description>
<filter-class>br.com.FilterOne</filter-class>
</filter>
<filter>
<filter-name>FilterTwo</filter-name>
<display-name>FilterTwo</display-name>
<description></description>
<filter-class>br.com.FilterTwo</filter-class>
</filter>
.
.
.
<filter-mapping>
<filter-name>FilterOne</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>FilterTwo</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
.
.
.

Gl�nio Alexandre
Brasilia/DF, Brazil
gudla Dathathreya Reddy
Greenhorn

Joined: May 05, 2004
Posts: 15
What is the error you are getting?
Glenio Alexandre Nogueira
Greenhorn

Joined: Dec 02, 2004
Posts: 4
Originally posted by gudla Dathathreya Reddy:
What is the error you are getting?


Hi. There isn�t a error message. I can�t get the second filter. I looked for a solution that It could use 2 or more filters,
but I found just one that used a class implementing Filter + a servlet

<filter-mapping>
<filter-name>FilterOne</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>FilterTwo</filter-name>
<servlet-name>ServletClass</url-pattern>
</filter-mapping>

and not a class implementing Filter + another class implementing Filter

<filter-mapping>
<filter-name>FilterOne</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>FilterTwo</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>

Did you understand me?

Thank you very much.
Gl�nio Alexandre
sawan parihar
Ranch Hand

Joined: Aug 24, 2004
Posts: 250
Hello Alexandre,
To call the next filter in the chain you need to give a call to FilterChain.doFilter(request,response). This will call the next filter in the chain.

Hope that helps.


Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Filter Chain: Standard Filter Strategy