New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring MVC do not resolve correctly Custom Validation messages using Hibernate Validator [SPR-8658] #13300
Comments
Stephen Morrison commented Are there any workarounds for this? I am also able to recreate this issue. |
Rossen Stoyanchev commented I've created a project for the issue in the Spring Framework Issues repository but I can't seem to be able to reproduce it. Feel free to fork, modify, and submit a pull request: https://github.com/SpringSource/spring-framework-issues/tree/master/SPR-8658 |
Rossen Stoyanchev commented Anyone who experienced the issue, please send a pull request for this to have any chance of being included in Spring 3.1 GA. |
Eduardo Narros commented I am able to reproduce this in 3.1.0.RELEASE. Also if I plug my own interpolator into the LocalValidatorFactoryBean, it does not get called and instead the hibernate defaults continue being used. |
Rossen Stoyanchev commented Would you be able to demonstrate it? See comments above and link to Issues repository. |
Eduardo Narros commented Hi Rossen, thanks for you quick reply, I was missing the setting of the validator attribute at: <mvc:annotation-driven validator="validator"/> I was not aware of it, kind regards |
Rossen Stoyanchev commented Ok, thanks for verifying. I am resolving this issue for now until it can be demonstrated. |
Angel commented I confirm the issue was related to the usage of this: <mvc:annotation-driven /> instead of this: <mvc:annotation-driven validator="validator"/> I think this point in the doucmentation: http://static.springsource.org/spring/docs/current/spring-framework-reference/htmlsingle/spring-framework-reference.html#validation-mvc-jsr303 might be causing confussion about how the convention over configuration is handled... |
Angel opened SPR-8658 and commented
I have the following Spring beans definition file:
the following properties:
and this POJO:
If I execute this test:
After executing the test I get the following result:
But if I try to do same within a form using Spring MVC the resolved message is just this:
because the message interpolator is not resolving the brackets recursively as it is supposed to do:
http://docs.jboss.org/hibernate/validator/4.2/reference/en-US/html/validator-usingvalidator.html#section-message-interpolation
From the test above it is clear what the behaviour should be.
Affects: 3.1 M2
Referenced from: commits spring-attic/spring-framework-issues@d76b671
8 votes, 5 watchers
The text was updated successfully, but these errors were encountered: