• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding Filter invocation

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps posting the configuration and code in question would help.
 
Ranch Hand
Posts: 35
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic