public class UrlPattern extends Object
url-pattern: /status/* http://example.com/examples/status/synopsis 匹配 http://example.com/examples/status/complete?date=today 匹配 http://example.com/examples/status 匹配 http://example.com/examples/server/status 未匹配
url-pattern: *.map http://example.com/examples/US/Oregon/Portland.map 匹配 http://example.com/examples/US/Washington/Seattle.map 匹配 http://example.com/examples/Paris.France.map 匹配 http://example.com/examples/US/Oregon/Portland.MAP 未匹配 http://example.com/examples/interface/description/mail.mapi 未匹配
| 限定符和类型 | 字段和说明 |
|---|---|
private static Set<String> |
endsWithMatches
要求请求 URL 具有特定后缀的模式,例如“*.html”
|
private static Set<String> |
exactMatches
需要精确匹配的模式,例如“/test”
|
private static String |
EXTENSION_MAPPING_PATTERN |
private static String |
PATH_MAPPING_PATTERN |
private static Set<String> |
startsWithMatches
需要 URL 具有特定前缀的模式,例如“/test/*”
|
| 构造器和说明 |
|---|
UrlPattern() |
Copyright © 2021. All rights reserved.