public class PathMatchConfigurer extends ObjectSE
構成済みのパスマッチャーとパスヘルパーのインスタンスは、次のものに対して共有されます。
RequestMappingHandlerMapping
, SimpleUrlHandlerMapping
コンストラクターと説明 |
---|
PathMatchConfigurer() |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public PathMatchConfigurer setUseSuffixPatternMatch(BooleanSE suffixPatternMatch)
デフォルトでは、これは true
に設定されています。
public PathMatchConfigurer setUseTrailingSlashMatch(BooleanSE trailingSlashMatch)
デフォルト値は true
です。
public PathMatchConfigurer setUseRegisteredSuffixPatternMatch(BooleanSE registeredSuffixPatternMatch)
configure content negotiation
の実行時に明示的に登録されたパス拡張子に対してのみ、サフィックスパターンマッチングが機能するかどうか。これは、あいまいさを減らし、"." のような課題を回避するために一般的に推奨されます。他の理由でパスに表示されます。デフォルトでは、これは "false" に設定されています。
public PathMatchConfigurer setUrlPathHelper(UrlPathHelper urlPathHelper)
これを使用して、デフォルトの UrlPathHelper をカスタムサブクラスでオーバーライドするか、複数の HandlerMappings および MethodNameResolvers で共通の UrlPathHelper 設定を共有します。
public PathMatchConfigurer setPathMatcher(PathMatcher pathMatcher)
AntPathMatcher
public PathMatchConfigurer addPathPrefix(StringSE prefix, PredicateSE<ClassSE<?>> predicate)
接頭辞は、コントローラー型が対応する Predicate
と一致するすべての @RequestMapping
メソッドのマッピングを充実させるために使用されます。最初に一致する述語の接頭辞が使用されます。
HandlerTypePredicate
を使用してコントローラーをグループ化することを検討してください。
prefix
- 適用する接頭辞 predicate
- コントローラー型を一致させるための述語 @Nullable public UrlPathHelper getUrlPathHelper()
@Nullable public PathMatcher getPathMatcher()
@Nullable protected MapSE<StringSE,PredicateSE<ClassSE<?>>> getPathPrefixes()