I have an entity which has several fields with JSR303 annotated constraints. I want the user to set those fields in several steps. I thought view states with explicit binding properties would do the job.
I enable JSR303 validation by setting a LocalValidatorFactoryBean as validator bean for <webflow:flow-builder-services … validator="flowValidator"/>. hibernate-validator-5 is in the class path.
This doesn't do the job as I need it. With an enabled validator the view state validates the complete entity, which fails as there are @NotNull constraints. Although the view-state has only a subset.Code:@Configuration @ImportResource("classpath:/flow.xml") public class FlowConfiguration { @Bean LocalValidatorFactoryBean flowValidator() { return new LocalValidatorFactoryBean(); } }
It turns out that the best what I could do is remove each @NotNull (implicit and explicit) annotations from my entity. Is there no way to leave my entity contraint and have only those fields validated which are specified as explicit binding properties?HTML Code:<view-state id="insertUser" view="registration/insertUser" model="vendor"> <binder> <binding property="email" required="true" /> <binding property="name" required="true" /> </binder> … </view-state>
By further reading I found out that I'm talking about JSR-303 groups. Is there any support for validating groups with Spring web flow?
By further Reading I found that this feature comes in SWF 2.4:
https://jira.springsource.org/browse/SWF-1453


Reply With Quote
