| 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
|
 |
 |
|
|
subject: Q on filters?
|
|
|