Given the following deployment descriptor, identify the sequence of fi lters that execute on a direct client request for ServletA. (Choose one.)
A. LogFilter, AuditFilter, EncryptionFilter B. LogFilter, EncryptionFilter C. LogFilter D. EncryptionFilter, AuditFilter, LogFilter E. EncryptionFilter, LogFilter F. AuditFilter, EncryptionFilter, LogFilter
This is what i want to say - The client can request by using these url patterns - /* or /ServletA. Now keeping in mind that filters with <url-pattern> are executed before those with <ervlet-name>, the sequence of filter execution should be as given in option F. But the book (David Bridgewater-page 234) this -
E is the correct answer. First, the processing works through the filter-mappings with a matching URL pattern. EncryptionFilter runs because the URL pattern of �/*� matches any request. Then processing works through the filter mappings with matching servlet names.LogFilter has a matching name, so it executes. Note that filters mapped by URL pattern are executed before filters mapped by servlet name.
What pricks me is that in light of the things given in head first's filter chapter, we are not able to answer this question.
the mock on filter in the HFSJ is also very very very weird. It is not at all releted to what is said in the text ! I never found HFSJ saying that the <url-pattern> like /* and / behave differently !!
Please help me out.
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ] Performance is a compulsion, not a option, if my existence is to be justified.