getServletPath
java.lang.String getServletPath()
- Returns the part of this request's URL that calls the servlet. This path starts with a "/" character and includes either the servlet name or a path to the servlet, but does not include any extra path information
or a query string. Same as the value of the CGI variable SCRIPT_NAME.
This method will return an empty string ("") if the servlet used to process this request was matched using the "/*" pattern.
-
-
- Returns:
- a
Stringcontaining the name or path of the servlet being called, as specified in the request URL, decoded, or an empty string if the servlet used to process the request is matched using the "/*" pattern.
- a
本文深入解析了Java中getServletPath()方法的用途、返回值及其应用场景,帮助开发者更好地理解Servlet路径的相关概念。
1675

被折叠的 条评论
为什么被折叠?



