Fix documentation on extending Spring MVC

When extending `WebMvcConfigurerAdapter`, developers should always
declare those as `@Configuration` classes rather than `@Bean`s, which
can lead to dependency issues as described in #6853.

Fixes gh-6853
This commit is contained in:
Brian Clozel 2016-09-09 09:45:54 +02:00
parent 0233455612
commit f0259c82de

View File

@ -1598,7 +1598,7 @@ The auto-configuration adds the following features on top of Spring's defaults:
If you want to keep Spring Boot MVC features, and
you just want to add additional {spring-reference}#mvc[MVC configuration] (interceptors,
formatters, view controllers etc.) you can add your own `@Bean` of type
formatters, view controllers etc.) you can add your own `@Configuration` class of type
`WebMvcConfigurerAdapter`, but *without* `@EnableWebMvc`. If you wish to provide custom
instances of `RequestMappingHandlerMapping`, `RequestMappingHandlerAdapter` or
`ExceptionHandlerExceptionResolver` you can declare a `WebMvcRegistrationsAdapter`