GeeCON Prague 2014*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt in ordering of filters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt in ordering of filters" Watch "Doubt in ordering of filters" New topic
Author

Doubt in ordering of filters

harinath chakrapani
Ranch Hand

Joined: Jun 11, 2007
Posts: 40
In page 678 it given that there are some rules for the orderin which filters are invoked but this conflicts with the next page exercise.

please help me how filters are invoked and how it takes place what is the procedure to be followed in finding the order...



Please help me of how filter sequence is obtained for each Request path from above specified filtes..

Thanks in Advance...
Kunal Jag
Ranch Hand

Joined: Jun 08, 2008
Posts: 31
Hi Harinath,
You've not mentioned the book name you're referring.

You can configure the DD to create a filter chain so that each filter is executed in a predefined order. The order of <filter-mapping> elements in the DD determines the execution order of the filters applied to web components that match the <url-pattern> tag. According to the servlet specification, the order the container uses in building the chain of filters to be applied for a particular request URI is as follows:
1. First, the <url-pattern> matching filter mappings in the same order that these elements appear in the DD.
2. Next, the <servlet-name> matching filter mappings in the same order that these elements appear in the DD.
This means that a filter mapped with the <url-pattern> element is always preferred over another filter mapped with <servlet-name> element.

I hope this will help.

Regards,
[ June 08, 2008: Message edited by: Kunal Jag ]

Kunal Jaggi<br />Author of <a href="http://www.tatamcgrawhill.com/html/titleDetail.jsp?isbn=9780070249103.html" target="_blank" rel="nofollow">"SCWCD Exam Guide"</a>, SCWCD 5 (exam 310-083 and 310-084), <a href="http://www.tatamcgrawhill.com/html/titleDetail.jsp?isbn=9780070249103.html" target="_blank" rel="nofollow">McGraw-Hill</a><br /><a href="http://javaevangelist.com/" target="_blank" rel="nofollow">http://javaevangelist.com/</a><br /><a href="http://www.oreillynet.com/pub/au/2669" target="_blank" rel="nofollow">http://www.oreillynet.com/pub/au/2669</a>
 
GeeCON Prague 2014
 
subject: Doubt in ordering of filters