• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

servlet mapping

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

In head first book , page 587 ,

Question:
For this request ,
http://localhost:8080/MapTest/fooStuff/bar/foo.fo
what would be the container's choice among the following mappings ?



The answer is Three.Can somebody explains me how the answer is Three ?

Thanks,
Amol
 
Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The pattern "/fooStuff/bar" doesn't match the URL; since it doesn't contain a wildcard it requires an exact match.

If the pattern were "/fooStuff/bar/*" then it would be matched instead of "/fooStuff/*" because it is more specific.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Following are different match types one can define in the Deployment Descriptor (DD) web.xml file.

Exact Match
An exact match ends with an extension, like .do or .process. This type of match has the highest priority and resolved first if one such exists.

Example:


Directory Match
A directory match ends with an asterisk (*).
Example:


Extension Match
Extension MatchStarts with an asterisk and ends with an extension. This type of match has the least priority and resolved if the other two match types are not resolved.

Example:
 
Amol Fuke
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf and Kunal !

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