Implicit Mappings
If the container has an internal JSP container, the
*.jsp
extension is mapped to it, allowing JSP pages to be executed on demand. This mapping is termed an implicit mapping. If a
*.jsp
mapping is defined by the Web application, its mapping takes precedence over the implicit mapping.
A servlet container is allowed to make other implicit mappings as long as explicit mappings take precedence. For example, an implicit mapping of *.shtml
could be mapped to include functionality on the server.
Example Mapping Set
Path Pattern | Servlet |
---|---|
/foo/bar/*
|
servlet1 |
/bar/*
|
servlet2 |
/catalog
|
servlet3 |
*.bop
|
servlet4 |
The following behavior would result:
Incoming Path | Servlet Handling Request |
---|---|
|
servlet1 |
|
servlet1 |
|
servlet2 |
|
servlet3 |
|
"default" servlet |
|
servlet4 |
|
servlet4 |
/catalog/index.html
and
/catalog/racecar.bop
, the servlet mapped to "/catalog
" is not used because the match is not exact.