• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Doubt on Filters - P.No: 680, HFSJ

 
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everybody,
in p.no 680 of HFSJ i am surprised on the answers for the Request path 2 and 5.

can any body explain me how the URL matching happens here .Is it same as
Exact, Directory and Extension matching used by container for resource finding, if this is the case, then for the Request path 2 the answer should be 2, 1, 5.

Could any body clear my doubt.

Any help is appreciated.
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<Filter mapping> can be done either using <url-pattern> or <servlet-
name>


Follow this process

All the filters with matching URL pattern are placed in the chain in
the order in which they are declared in DD.

Then all the filters with matching <servlet-name> are placed in the
chain in the order in which they are declared in DD.

Now for example
Recipes/HopsList.do has the matching

<url-pattern>/Recipes/*</url-pattern> ----------------1
<url-pattern>/*</url-pattern> ------------------------5
<servlet-name>/Recipes/HopsList.do</servlet-name> ----2

Here all filters with matching URL patterns are placed first and then
all filters with matching servlet-name

Regards
Gaurav
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic