Form validation not working for Hibernate validation annotations when using Facelets
composition components
-----------------------------------------------------------------------------------------------------------
Key: JBSEAM-919
URL:
http://jira.jboss.com/jira/browse/JBSEAM-919
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 1.1.6.GA
Reporter: P B
Attachments: facelets-composition-comp-validation.zip
This was first reported in the ICEfaces forums
(
http://www.icefaces.org/JForum/posts/list/0/3825.page#17329), but seems to occur without
ICEfaces.
The Seam JSF Form validation does not happen for Hibernate annotated validations when
using a Facelets composition component. When posting a form containing invalid values the
validations that should occur for Seam components referenced in a Facelets composition
component do not produce any ui error messages and instead cause the following sort of
exception at EntityInsertAction.preInsert() stage:
- Exception
Exception during request processing: validation failed for:
org.jboss.seam.example.booking.User
org.hibernate.validator.event.ValidateEventListener.validate(ValidateEventListener.java:132)
org.hibernate.validator.event.ValidateEventListener.onPreInsert(ValidateEventListener.java:156)
org.hibernate.action.EntityInsertAction.preInsert(EntityInsertAction.java:139)
org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:44)
org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
org.jboss.tm.TxManager.commit(TxManager.java:240)
Steps to reproduce:
1. drop the test case files in the booking example
the test case defines a simple facelets composition component that shows an
h:inputText, and uses it for the user name field on the register.xhtml page.
2. build the booking example
3. start the web app and navigate to the registration page
4. enter form values, leaving an invalid entry in the user name field
5. post the page, and an exception should be produced
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira