Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Filters

 
kathir vel
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
In HFSJ page680 there is excercise , How the container will order the filters in Filter Chain?
I thought the order(Container will order Filters based on the order the Filters declaredd in DD),for the following requests are :

/Recipes/HopsList.do Filters : 1,2,5
/Recipes/Modify/ModRecipes.do Filters : 1,4,5

But the answers are wrong.1,5,2 and 1,5,4.
Can anyone explain how?
Is it only one FilterChain object for the whole application? Advance Thanks.
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got this wrong the first time too!

It matches the URL pattern first then the servlet name. First pass is thru the entries trying to match the URL patern, then back to the top of the list and thru again matching by Servlet name.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!