Is it possible for Spring's JSR-303 implementation to validate object fields that are not from form input?
Hibernate's validator is my JSR-303 provider in my Spring MVC application. When I use @Valid, and then use the JSR-303 annotations on the form object fields, it validates just fine. However, there a开发者_开发问答re some instances where I want to validate object fields that do not map one-to-one with jsp input fields. For example, I have a registration form with password and re-enter password input fields. The validation constraint should be @AssertTrue on a boolean object field that looks to see if password and re-enter password match. Hibernate's documentation shows that this is possible, but you have to invoke the validator manually, which defeats the purpose of my current approach with Spring annotations. Is there a way to do this in Spring without invoking the Hibernate validator?
http://forum.springsource.org/showthread.php?t=99682
精彩评论