How are Servlet paths mapped?
The following types of mapping are supported and applied in the order presented.
Absolute Mapping
Path Spec: /path
Will match: /path path=/path info=<null>
Will not match: / /path/ /path/info /path/info.jsp /other</null>
Prefix Mapping
Path Spec: /path/*
Will match: /path path=/path info=<null> /path/ path=/path info=/ /path/info path=/path info=/info /path/info.jsp path=/path info=/info.jsp
Will not match: / /other</null>
Suffix Mapping
Path Spec: *.jsp
Will match: /path/info.jsp path=info=/path/info.jsp
Will not match: / /path /path/ /path/info /other
Default Mapping
Path Spec: /
Will match: / path= info=/ /path path= info=/path /path/ path= info=/path/ /path/info path= info=/path/info /path/info.jsp path= info=/path/info.jsp /other path= info=/other
Will not match:
Typical examples
Context and Servlet with path
Context Path Spec : /context/* Servlet Path Spec : /servlet/*
URI ContextPath ServletPath PathInfo ========================================================= /context/servlet /context /servlet null /context/servlet/ /context /servlet / /context/servlet/x /context /servlet /x
Default Context
Context Path Spec : / Servlet Path Spec : /servlet/*
URI ContextPath ServletPath PathInfo ========================================================= /servlet "" /servlet null /servlet/ "" /servlet / /servlet/x "" /servlet /x
Context and Suffix Servlet
Context Path Spec : /context/* Servlet Path Spec : *.txt
URI ContextPath ServletPath PathInfo ========================================================= /context/xxx.txt /context "" /xxx.txt
Context and Default Servlet
Context Path Spec : /context/* Servlet Path Spec : /
URI ContextPath ServletPath PathInfo ========================================================= /context/xxx /context "" /xxx
Default Context and Servlet
Context Path Spec : / Servlet Path Spec : /
URI ContextPath ServletPath PathInfo ========================================================= /xxx "" "" /xxx
:http://jetty.mortbay.org/jetty/faq?s=500-Servlets&t=Path%20Mapping
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
JSP| EL (Experession Language)텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.