Can someone explain how filters are mapped to a URL pattern and/or servlet name?
I read this topic in HEAD FIRST SERVLET & JSP, but still its not clear.
Do provide examples for better understanding.
My question is that why in no.2) above, filter sequence is 1,5,2 and not 1,2,5. Similar doubt in no.3)? why no.4) above only evaluates to filter5, why not filter2 too??
because /HopsList.do matches only Filter5 <url-pattern>??
Yes, the Filter with an url pattern of "/*" is applied to all the servlets and static content pages in the Web application, because every request URI matches the "/*" URL pattern.
So you basically need to sort filter according to two parameters, first by whether it is url-pattern or servlet-name, url-pattern coming first. And second by the order of declaration in DD file.
I hope this helped.
Post by:autobot
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
a bit of art, as a gift, the permaculture playing cards