Closed spring-projects-issues closed 10 months ago
Juergen Hoeller commented
The problem here is that setValidationMessageSource relies on non-standard features in Hibernate Validator, even requiring Hibernate Validator 4.1 or higher there. As of Bean Validation 1.1 (coming next year as part of the EE 7 umbrella), we might get a standard variant for customizing message lookup which suggests that we can do it by default then. However, this will be considered within the Spring Framework 3.3 timeline, not within 3.2 anymore.
Juergen
Simon Wong commented
Could I know whether Spring 4 support the customized message lookup if Bean Validation 1.1 is in use?
Juergen Hoeller commented
Yes, it does - but just against Hibernate Validator 5, I'm afraid. Even as of Bean Validation 1.1, there is still no standard way to define a ResourceBundle for a MessageInterpolator, other than through Hibernate's custom ResourceBundleLocator mechanism...
Juergen
Simon Wong opened SPR-9708 and commented
Status Quo
WebMvcConfigurationSupport
instantiates aLocalValidatorFactoryBean
if JSR 303 is supported. However, it does not set the SpringMessageSource
as themessageInterpolator
by default.Workaround
Extend
WebMvcConfigurationSupport
and add the following 2nd statement.Affects: 3.1 GA, 3.1.1, 3.1.2
Issue Links:
16248 Add support for custom messages when using Apache BVAL as JSR303 validation provider
2 votes, 7 watchers