Browse Source

Doc: no "useCodeAsDefaultMessage" for setValidationMessageSource

Issue: SPR-15986
pull/1654/head
Juergen Hoeller 8 years ago
parent
commit
37ab8a700b
  1. 7
      spring-context/src/main/java/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.java

7
spring-context/src/main/java/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -157,6 +157,11 @@ public class LocalValidatorFactoryBean extends SpringValidatorAdapter
* not both. If you would like to build a custom MessageInterpolator, consider deriving from * not both. If you would like to build a custom MessageInterpolator, consider deriving from
* Hibernate Validator's {@link ResourceBundleMessageInterpolator} and passing in a * Hibernate Validator's {@link ResourceBundleMessageInterpolator} and passing in a
* Spring-based {@code ResourceBundleLocator} when constructing your interpolator. * Spring-based {@code ResourceBundleLocator} when constructing your interpolator.
* <p>In order for Hibernate's default validation messages to be resolved still, your
* {@link MessageSource} must be configured for optional resolution (usually the default).
* In particular, the {@code MessageSource} instance specified here should not apply
* {@link org.springframework.context.support.AbstractMessageSource#setUseCodeAsDefaultMessage
* "useCodeAsDefaultMessage"} behavior. Please double-check your setup accordingly.
* @see ResourceBundleMessageInterpolator * @see ResourceBundleMessageInterpolator
*/ */
public void setValidationMessageSource(MessageSource messageSource) { public void setValidationMessageSource(MessageSource messageSource) {

Loading…
Cancel
Save