Skip to content

Commit ce94026

Browse files
committed
Doc: no "useCodeAsDefaultMessage" for setValidationMessageSource
Issue: SPR-15986 (cherry picked from commit 37ab8a7)
1 parent a041769 commit ce94026

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

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

0 commit comments

Comments
 (0)