Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

filter execution sequence question

 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Tha�s Manfrim Firmino
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't understand: are you in doubt or not about that exercise? If yes, the correct answer is E because the client did a request and so the filter that only applies to forward won't execute.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i didnt get it !
somebody please explain more !
 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only thing left to say is that a "FORWARD value activates the filter for request dispatching from a forwar() call"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic