Spring Webflow model validation. -
we have developed internet bank project in our company. have used spring-mvc in project , of property validations have been carried out using hibernate validator. of our services have state-machine nature, need use spring-webflow.
in doing need validate models in spring webflow without adding validators. know there 2 ways validate model programmatically:
- define validation logic in model object.
- define separate object called validator validate model.
however, not want use none of these validation techniques.
for example lets imagine had class named customer. used annotation validation properties in class in our project. now, want use class model in view states in our webflow.
i wondering if how validate models in spring webflow using annotation validation hibernate validator.
spring webflow 2.4 supports jsr-303 validation , partial validation through use of validation groups.
you need add following application context xml file:
<webflow:flow-registry flow-builder-services="flowbuilderservices" /> <webflow:flow-builder-services id="flowbuilderservices" validator="validator" /> <bean id="validator" class="org.springframework.validation.beanvalidation.localvalidatorfactorybean" />
this allow validate model objects using annotations.
Comments
Post a Comment