更新时间:2023-12-04 11:35:10
模式 /
将使您的servlet成为应用程序的默认servlet,这意味着它将获取每个没有其他完全匹配的模式。
The pattern /
will make your servlet the default servlet for the app, meaning it will pick up every pattern that doesn't have another exact match.
- A以/字符开头并以
/ *
后缀结尾的字符串用于路径映射。- 以 *。前缀用作扩展名映射。
- 仅包含
/
的字符串>字符表示应用程序的默认 servlet。在这种情况下,servlet路径是请求URI减去上下文路径,路径信息是null
。- 使用所有其他字符串仅限完全匹配。
- A string beginning with a / character and ending with a
/*
suffix is used for path mapping.- A string beginning with a
*.
prefix is used as an extension mapping.- A string containing only the
/
character indicates the default servlet of the application. In this case the servlet path is the request URI minus the context path and the path info isnull
.- All other strings are used for exact matches only.
/
字符作为路径分隔符一次单击目录的路径树来完成的。最长匹配确定所选的servlet。 .jsp
),则servlet容器将尝试匹配处理扩展请求的servlet。扩展名定义为最后一个。
字符后的最后一个部分的一部分。/
character as a path separator. The longest match determines the servlet selected..jsp
), the servlet container will try to match a servlet that handles requests for the extension. An extension is defined as the part of the last segment after the last .
character.