File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Q on filters? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Q on filters?" Watch "Q on filters?" New topic
Author

Q on filters?

Jingh Yi
Ranch Hand

Joined: Mar 23, 2005
Posts: 90
HFSJ pp678:

The container's rules for ordering filters: when more than one filter is mapped to a given resource:
- 1. ALL filters with matching URL patterns are located first. The order will be the order they are declared in DD.
- 2. Once all filters with matching URLs are placed in the chain, the Container does the same thing with the filters that have a matching <servlt-name> in the DD.


I tried to have 2 filters mapped to one URL like this:

<filter-mapping>
<filter-name>JspFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>BeerRequest</filter-name>
<servlet-name>*.jsp</servlet-name>
</filter-mapping>


According to HFSJ, both filters will be called, in the order they are defined in DD, right? But how come only one filter is called?

Thanks!
Jenny
Jingh Yi
Ranch Hand

Joined: Mar 23, 2005
Posts: 90
Sorry, guys. My bad on the DD. it should be:


<filter-mapping>
<filter-name>BeerRequest</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>


Now it works as HFSJ says.

Have a nice weekend, guys!
Jenny
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Q on filters?
 
Similar Threads
Doubt on Filters - P.No: 680, HFSJ
Doubt in ordering of filters
[Solved][HFSJ] Filter Preferences
unable to understand filter execution sequence
HFSJ Page 696 decalring filters in DD