• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Q. on Servlet Mapping Specification (re-post)

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

Could someone elaborate further these 2 specifications:

(I)

SRV.11.1

2. The container will recursively try to match the longest path-prefix. This is done by stepping down the path tree a directory at a time, using the / character as a path separator. The longest match determines the servlet selected.


Question:

Supposing your mapping is as follows:
<servlet-name>servlet3</servlet-name>
<url-pattern>/catalog</url-pattern>

And your URL is /catalog/index.html

Does recursively means the following:

1. Try to match /catalog/index.html. Not found!
2. Step down the path tree which will give you /catalog. Try to match - Found!

II

SRV.11.2

A string beginning with a / character and ending with a /* suffix is used for path mapping.


Question:
Suppose you have a mapping of /foo/bar/*, is the string used for path mapping only includes those characters inside the / and /*, i.e. only foo/bar is used in this example?

Thanks.
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic