@EnableWebMvc.
@EnableWebMvc-annotated configuration classes may implement
this interface to be called back and given a chance to customize the
default configuration.
| Modifier and Type | Method and Description |
|---|---|
| public default void | addArgumentResolvers(List<HandlerMethodArgumentResolver>
initially an empty list resolvers)Add resolvers to support custom controller method argument types. |
| public default void | |
| public default void | addFormatters(FormatterRegistry registry)
Add |
| public default void | addInterceptors(InterceptorRegistry registry)
Add Spring MVC lifecycle interceptors for pre- and post-processing of controller method invocations and resource handler requests. |
| public default void | addResourceHandlers(ResourceHandlerRegistry registry)
Add handlers to serve static resources such as images, js, and, css files from specific locations under web application root, the classpath, and others. |
| public default void | addReturnValueHandlers(List<HandlerMethodReturnValueHandler>
initially an empty list handlers)Add handlers to support custom controller method return value types. |
| public default void | addViewControllers(ViewControllerRegistry registry)
Configure simple automated controllers pre-configured with the response status code and/or a view to render the response body. |
| public default void | configureAsyncSupport(AsyncSupportConfigurer configurer)
Configure asynchronous request handling options. |
| public default void | configureContentNegotiation(ContentNegotiationConfigurer configurer)
Configure content negotiation options. |
| public default void | configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer)
Configure a handler to delegate unhandled requests by forwarding to the Servlet container's "default" servlet. |
| public default void | configureHandlerExceptionResolvers(List<HandlerExceptionResolver>
initially an empty list resolvers)Configure exception resolvers. |
| public default void | configureMessageConverters(List<HttpMessageConverter<?>>
initially an empty list of converters converters)Configure the |
| public default void | configurePathMatch(PathMatchConfigurer configurer)
Help with configuring |
| public default void | configureViewResolvers(ViewResolverRegistry registry)
Configure view resolvers to translate String-based view names returned from
controllers into concrete |
| public default void | extendHandlerExceptionResolvers(List<HandlerExceptionResolver>
the list of configured resolvers to extend resolvers)Extending or modify the list of exception resolvers configured by default. |
| public default void | extendMessageConverters(List<HttpMessageConverter<?>>
the list of configured converters to be extended converters)Extend or modify the list of converters after it has been, either
|
| public default MessageCodesResolver | getMessageCodesResolver()
Provide a custom |
| public default Validator |
| addArgumentResolvers | back to summary |
|---|---|
| public default void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) Add resolvers to support custom controller method argument types. This does not override the built-in support for resolving handler
method arguments. To customize the built-in support for argument
resolution, configure
| |
| addCorsMappings | back to summary |
|---|---|
| public default void addCorsMappings(CorsRegistry registry) Configure "global" cross-origin request processing. The configured CORS mappings apply to annotated controllers, functional endpoints, and static resources. Annotated controllers can further declare more fine-grained config via
| |
| addFormatters | back to summary |
|---|---|
| public default void addFormatters(FormatterRegistry registry) Add | |
| addInterceptors | back to summary |
|---|---|
| public default void addInterceptors(InterceptorRegistry registry) Add Spring MVC lifecycle interceptors for pre- and post-processing of controller method invocations and resource handler requests. Interceptors can be registered to apply to all requests or be limited to a subset of URL patterns. | |
| addResourceHandlers | back to summary |
|---|---|
| public default void addResourceHandlers(ResourceHandlerRegistry registry) Add handlers to serve static resources such as images, js, and, css files from specific locations under web application root, the classpath, and others.
| |
| addReturnValueHandlers | back to summary |
|---|---|
| public default void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> handlers) Add handlers to support custom controller method return value types. Using this option does not override the built-in support for handling return values. To customize the built-in support for handling return values, configure RequestMappingHandlerAdapter directly.
| |
| addViewControllers | back to summary |
|---|---|
| public default void addViewControllers(ViewControllerRegistry registry) Configure simple automated controllers pre-configured with the response status code and/or a view to render the response body. This is useful in cases where there is no need for custom controller logic -- e.g. render a home page, perform simple site URL redirects, return a 404 status with HTML content, a 204 with no content, and more.
| |
| configureAsyncSupport | back to summary |
|---|---|
| public default void configureAsyncSupport(AsyncSupportConfigurer configurer) Configure asynchronous request handling options. | |
| configureContentNegotiation | back to summary |
|---|---|
| public default void configureContentNegotiation(ContentNegotiationConfigurer configurer) Configure content negotiation options. | |
| configureDefaultServletHandling | back to summary |
|---|---|
| public default void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) Configure a handler to delegate unhandled requests by forwarding to the
Servlet container's "default" servlet. A common use case for this is when
the | |
| configureHandlerExceptionResolvers | back to summary |
|---|---|
| public default void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> resolvers) Configure exception resolvers. The given list starts out empty. If it is left empty, the framework
configures a default set of resolvers, see
Alternatively you can use
| |
| configureMessageConverters | back to summary |
|---|---|
| public default void configureMessageConverters(List<HttpMessageConverter<?>> converters) Configure the By default, all built-in converters are configured as long as the corresponding 3rd party libraries such Jackson JSON, JAXB2, and others are present on the classpath. Note that use of this method turns off default converter
registration. However, in a Spring Boot application the
| |
| configurePathMatch | back to summary |
|---|---|
| public default void configurePathMatch(PathMatchConfigurer configurer) Help with configuring
| |
| configureViewResolvers | back to summary |
|---|---|
| public default void configureViewResolvers(ViewResolverRegistry registry) Configure view resolvers to translate String-based view names returned from
controllers into concrete
| |
| extendHandlerExceptionResolvers | back to summary |
|---|---|
| public default void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> resolvers) Extending or modify the list of exception resolvers configured by default. This can be useful for inserting a custom exception resolver without interfering with default ones.
| |
| extendMessageConverters | back to summary |
|---|---|
| public default void extendMessageConverters(List<HttpMessageConverter<?>> converters) Extend or modify the list of converters after it has been, either
Note that the order of converter registration is important. Especially
in cases where clients accept
| |
| getMessageCodesResolver | back to summary |
|---|---|
| public default MessageCodesResolver getMessageCodesResolver() Provide a custom
| |
| getValidator | back to summary |
|---|---|
| public default Validator getValidator() Provide a custom
| |