Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding Filter invocation  RSS feed

 
shashank pratap
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Head First Servlets and jsp

on page no. 710 in the Important black box " Filters with matching URL patterns are placed in the chain in the order in which they are declared in the DD"


on page no.712 request path -> /Recipes/HopsList.do should have the sequence 1,2,5 but in the answer on page 727 its 1,5,2
on page no.712 request path -> /Recipes/Modify/ModRecipes.do should have the sequence 1,4,5 but in the answer on page 727 its 1,5,4

can any one tell me the reason , and how is it working?

Please help me .

Shashank.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps posting the configuration and code in question would help.
 
Jessid Leon Velez Gutierrez
Ranch Hand
Posts: 35
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shashank pratap wrote:In Head First Servlets and jsp

on page no. 710 in the Important black box " Filters with matching URL patterns are placed in the chain in the order in which they are declared in the DD"


on page no.712 request path -> /Recipes/HopsList.do should have the sequence 1,2,5 but in the answer on page 727 its 1,5,2
on page no.712 request path -> /Recipes/Modify/ModRecipes.do should have the sequence 1,4,5 but in the answer on page 727 its 1,5,4

can any one tell me the reason , and how is it working?

Please help me .

Shashank.


Hello shashank pratap. Perhaps this is to late, but I am studying the very same book and had your very same question. I have just solved when I was typing the xlm code. Here is the reason:

For Filter2 and for Filter4 they are using <servlet-name> tag and NOT <url-pattern>, as done for Filter1, Filter3 and Filter5. And according to what they say on page 710, the container places first the matching url-patterns and after that, the servlet-name matching...name?

Thanks for asking, because I have just solved my question because of yours

Best reggards!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!