I guess this is because the mechanism of url-pattern match
I remember that ,container will match the url for longest possible matching first, then try to match the .suffix pattern.
If this is true ,then the answer could be explained. First a path Recipes/HopsList.do the container go through the filters for Recipes/HopsList find 1, 5, maching(The order is in dd) then for suffix mapping , find 2 .
But this is my own assumption. Hope somebody to clarify this .
First the container keeps in Q the filters with the matching URL pattern in the order in which they appear in the DD.Then the order is followed by the filters with the matching servlet name...Even I was confused at first but after reading carefully the white text in black box there in HFS,....I could come to a conclusion.
Javainn<br /> <br />SCJP,SCWCD,SCBCD,<br />ICED (IBM-287,IBM-484,IBM-486)
IBM certified in DB2 V 8.1 Family Fundamentals (IBM 700)
1. How can a <servlet-name> tag in a filter definition contain an url-pattern? Is it not supposed to contain the name of the servlet to which the filter applies? Your initial posting has a mistake. Filter 2 mapping has <servlet-name> in the HFS book, not <url-pattern>.
2. The url-pattern /* (the last one) is defined as the last. So this filter would be included in every request but only as the LAST!. Isn't it? No.
tiim, Even if I assume the longest possible path comes first, then also the url-pattern /* (the last one), should come at the end, isn't it?.
HF book in its Container rules(p:80) for filters clearly says that the algorithm is different. It doesn't pick up the longest possible path match, but picks up all of the url-patterns that match, place them in the filter chain and execute them one by one, in the order they are defined in the DD.