File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
jQuery in Action, 2nd edition
 
subject: Doubt regarding an answer in HFSJ-Filters
 
Similar Threads
Doubt in ordering of filters
HFSJ - Page 695
[Solved][HFSJ] Filter Preferences
HFSJ filter-sequence doubt
Filter Q in HF Book