• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt regarding an answer in HFSJ-Filters

 
J Johny Rufus
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
For the Sharpen Your Pencil Answers on page 695,
The answers for the filter sequence are given as
/Recipes/hopList.do 1 5 2
/Recipes/Modify/ModRecipes.do 1 5 4

but should not they be

/Recipes/hopList.do 1 2 5
/Recipes/Modify/ModRecipes.do 1 4 5

because the filters are executed in the order they are declared in the web.xml and the given web.xml declares the filters in the order 1 2 3 4 5

Thanks,
Rufus
 
shiva viswanathan
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI ,

The container first selects all the url-patterns with matching names as per order in dsadm
Then all the servlet-name with matching names as per order in dsadm

This decides the order

In other words url-pattern has higher preference than servlet name

Catch You Later
Shiva
 
shiva viswanathan
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry "as per order in dsadm" should read "as per order in DD"
 
J Johny Rufus
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Shiva,

Now I understand the reason for the given sequence in the book .


Thanks and Regards,
Rufus
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic