Hi Vishwa,
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.
Here is the filter spec in the DD in a matrix.
DD <url-pattern> DD <servlet-name>
Filter 1 /Recipes/* -
Filter 2 - /Recipes/HopsList.do
Filter 3 /Recipes/Add/* -
Filter 4 - /Recipes/Modify/ModRecipes.do
Filter 5 /* -
Let's say we get a request URL /Recipes/HopsList.do.
Applying rule 1, Container goes thro' the <url-pattern> column looking for match. Filter 1 and 5 match.
Applying rule 2, Container goes thro' the <servlet-name> column. Filter 2 match.
So the order is 1 5 2. Isn't it straightforward ?
Makes sense?