Monday, October 23, 2006

Mapping URL to servlet


  • Request URI = context path + servlet path + path info

  • Context Path and Servlet Path start with a / but do not end with it.


Identifying Servlet Path

  1. Exact match of URI to any servlet mapping. In this case, entire match is servlet path and path info is null

  2. Recursive match the longest path by stepping down the request URI path tree to a directory at a time, using / character as a path separator.

  3. last node of request URI contains extension and there exists servlet that handles request for that extension,

  4. forward to default servlet. If no default servlet, send an error message

No comments: