Package org.springframework.web.filter
Interface UrlHandlerFilter.Builder.TrailingSlashSpec
- Enclosing interface:
- UrlHandlerFilter.Builder
public static interface UrlHandlerFilter.Builder.TrailingSlashSpec
A spec to configure a trailing slash handler.
-
Method Summary
Modifier and TypeMethodDescriptionintercept
(Consumer<HttpServletRequest> consumer) Configure a request consumer to be called just before the handler is invoked when a URL with a trailing slash is matched.redirect
(HttpStatus status) Handle requests by sending a redirect to the same URL but the trailing slash trimmed.Handle the request by wrapping it in order to trim the trailing slash, and delegating to the rest of the filter chain.
-
Method Details
-
intercept
Configure a request consumer to be called just before the handler is invoked when a URL with a trailing slash is matched. -
redirect
Handle requests by sending a redirect to the same URL but the trailing slash trimmed.- Parameters:
status
- the redirect status to use- Returns:
- the top level
UrlHandlerFilter.Builder
, which allows adding more handlers and then building the Filter instance.
-
wrapRequest
UrlHandlerFilter.Builder wrapRequest()Handle the request by wrapping it in order to trim the trailing slash, and delegating to the rest of the filter chain.- Returns:
- the top level
UrlHandlerFilter.Builder
, which allows adding more handlers and then building the Filter instance.
-