SRV.10.1 Use of URL Paths


Servlet containers must use URL paths to map requests to servlets. The container uses the RequestURI from the request, minus the context path, as the path to map to a servlet. The URL path mapping rules are as follows (where the first match wins and no further rules are attempted):

  1. The servlet container will try to match the exact path of the request to a servlet.

  2. The container will then try to recursively match the longest path prefix mapping. This process occurs by stepping down the path tree a directory at a time, using the '/' character as a path separator, and determining if there is a match with a servlet.

  3. If the last node of the url-path contains an extension ( .jsp for example), the servlet container will try to match a servlet that handles requests for the extension. An extension is defined as the part of the path after the last '.' character.

  4. If neither of the previous two rules results in a servlet match, the container will attempt to serve content appropriate for the resource requested . If a "default" servlet is defined for the application, it will be used in this case.



Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net