This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt regarding an answer in HFSJ-Filters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt regarding an answer in HFSJ-Filters" Watch "Doubt regarding an answer in HFSJ-Filters" New topic
Author

Doubt regarding an answer in HFSJ-Filters

J Johny Rufus
Ranch Hand

Joined: Oct 29, 2003
Posts: 47
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

Joined: Aug 12, 2004
Posts: 152
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

Joined: Aug 12, 2004
Posts: 152
sorry "as per order in dsadm" should read "as per order in DD"
J Johny Rufus
Ranch Hand

Joined: Oct 29, 2003
Posts: 47
Thanks Shiva,

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


Thanks and Regards,
Rufus
 
 
subject: Doubt regarding an answer in HFSJ-Filters