Sample / will make your servlet the default servlet for the application, that is, it will pick up each template that does not have a different exact match.
Display URL pattern:
- To match the path, use a line starting with the / character and ending with the
/* suffix. - A line starting with the prefix
*. , is used as a display of extensions. - A line containing only the
/ character indicates the default servlet. In this case, the servlet path is the request URI minus the context path, and the path information is null . - All other lines are used only for exact matches.
Rules for displaying the path:
- The container will try to find the exact match of the request path to the servlet path. A successful match selects the servlet.
- The container will recursively try to match the longest path prefix. This is done by gradually removing the directory tree at a time using the
/ symbol as a path separator. The greatest match is determined by the selected servlet. - If the last segment of the URL path contains an extension (for example,
.jsp ), the servlet container will try to map the servlet that processes requests for the extension. An extension is defined as part of the last segment after the last character . . - If none of the previous three rules results in a servlet match, the container will try to serve content that matches the requested resource. If a default servlet is defined for the application, it will be used.
source share