spring-boot/spring-boot-autoconfigure
Phillip Webb c9561f031c Refine validator and MVC validator configuration
Update `ValidationAutoConfiguration` and `WebMvcAutoConfiguration` to
ensure as much as possible that only a single Validator bean of each
type is registered.

Validation auto-configuration now does the following:
- If no validator is found: Registers a `LocalValidatorFactoryBean`
  (providing both Spring and JSR validation)
- If the user defines a Spring & JSR validator: Backs off
- If the user defines only a JSR validator: Adapts it to a Spring
  validator (without exposing another JSR implementation)

WebMvcAutoConfiguration auto-configuration has been updated to make
MVC validation follow common Spring Boot patterns:
- If not validator beans are found (due to the user excluding
  ValidationAutoConfiguration) a new `mvcValidator` bean will be
  registered.
- If a single validator bean is found it will be used for MVC
  validation.
- If multiple validator beans are defined it will either use the one
  named `mvcValidator` or it will register a new `mvcValidator` bean

Any automatically registered `mvcValidator` bean will not implement
the JSR validator interface.

Finally, it is no longer possible to provide an MVC validator via a
`WebMvcConfigurer`.

Fixes gh-8495
2017-04-19 22:18:12 -07:00
..
src Refine validator and MVC validator configuration 2017-04-19 22:18:12 -07:00
pom.xml Next Development Version 2017-03-03 16:18:26 +00:00