Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ pg727 order of filters

 
swati soni
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I m a little bit confused about the order of filter invocation in this exercise .
According to the DD and the order in which the filters are declared the order of

/Recipes/HopsList.do should be 1,2,5 and that of /Recipes/Modify/ModRecipes.do should be 1,4,5.
As thats what I found in /Recipes/Add/AddRecipes.do, which is : 1,3,5.
I m confused now .
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2534
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Swati,

Can you post the question? (as I don't have that book here)

Regards,
Frits
 
Parth Twari
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frits let me handle this one
Hi Swati,

I think you have not understood the filter mapping.

See:

Read page 710 part-

All filter with matching URL pattern are located first. And a chain is formed for the filters with matching url patterns.

Then filters with matching servlet-names are taken and another chain is formed.

Our url pattern ones are 1,3,5
our servlet name ones are 2,4

So see the chains in our question-

For /Recipes/HopsList.do matching patterns are 1,5 so they are invoked
then it matches servlet name so 2 is also invoked.
So, order becomes 1,5,2

For /Recipes/Modify/ModRecipes.do matching patterns are 1,5 so they are invoked
then it matches servlet names so 4 is also invoked.
So order ? 1 5 4 ofcourse.

in /Recipes/Add/AddRecipes.do three patterns are matching so url order 1,3,5
then it matches servlet names so where none is matched.

so order 1,3,5

Regards
 
swati soni
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Parth and Frits ... I got your point . Thanks for correcting me .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic