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

Filter sequence

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Head First book p.727, there is an answer to an exercise asking about the order of the filter:

Request Path : /Recipes/HopsList.do.
Filter sequence : filter1, filter5, filter2

But when I tried it in my code,
I have a ReceiptServlet.
I have this servlet url-pattern in web.xml


My Result is filter1, filter2, filter 5.


Why my result is different from the book's ?
 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I posted this question to the book's errata and waiting for confirmation.
Thanks Frits for providing me the errata page.
 
Maciej Zpolski
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Himai.
You have error in your web.xml. The second filter should have a <servlet-name> instead of the <url-pattern>.

Filters that have a matching <servlet-name> are ordered after filters with <url-name> matching.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic