-
1. Re: In which phase is seam validation executed?
mrossix Jul 30, 2009 5:46 PM (in response to magix)Interesting question ...
-
2. Re: In which phase is seam validation executed?
asookazian Jul 30, 2009 6:40 PM (in response to magix)As per Core JSF book:
The converted values are not immediately transmitted to the beans that make up the business logic. Instead, they are first stored inside the component objects as local values. After conversion, the local values are validated.If you are referring to Hibernate Validator annotations on the entity class methods, Seam forces JSF to evaluate those via <s:validate/> or <s:validateAll/> tags.
Then there's the Seam @Validator annotation for custom validation which is associated with the value of the validator attribute on a JSF control.
SiA:
The Hibernate Validator validations are applied twice, once in the UI to provide the
user feedback, thanks to the Hibernate Validator-JSF validator bridge registered by the
<s:validateAll> component tag, and once before the entity is persisted to ensure no
bad data ends up in the database. The model validations are applied alongside other
validators registered with the input component. -
3. Re: In which phase is seam validation executed?
joblini Jul 31, 2009 4:36 AM (in response to magix)Hello Matthias,
Hibernate validations are performed by s:validate during the JSF VALIDATE phase. They are performed against the input values, not against values in the model. As you correctly point out, the model has not been updated yet.
The validations are again performed, this time by the entity manager (hibernate) when the entity is persisted or updated. At this time, however, an exception is thrown if any validations fail.
Regards, Ingo