4 Replies Latest reply on Feb 26, 2007 3:31 PM by aggtecnologia

    Validation issue in adapted Registration example

    chopin

      Hi,

      in order to build my first seam application, I decided to adapt the Registration example. In the first step I changed the name of the context root and the jar, war, and ear files to myapp. After deploying everything works fine except JSF-Hibernate validation. Validation is only done during persisting the object. In case of invalid data no data constraints will be displayed. Why Seam or JSF does not trigger validation before persisting the user object?

      I changed the following files of the Registration example:
      application.xml
      - <web-uri>jboss-seam-registration.war</web-uri> -> <web-uri>myapp.war</web-uri>
      - <context-root>/seam-registration</context-root> -> <context-root>/myapp</context-root>
      - jboss-seam-registration.jar -> myapp.jar
      jboss-app.xml
      - seam.jboss.org:loader=seam-registration -> seam.jboss.org:loader=myapp
      components.xml
      - <core:init jndi-pattern="jboss-seam-registration/#{ejbName}/local"/> -> <core:init jndi-pattern="myapp/#{ejbName}/local"/>

      Without these changes JSF-Hibernate validation works fine.

      Any Ideas?

      Thanks in advance

        • 1. Re: Validation issue in adapted Registration example

          Do validations work in the original example? I hava a rather similar problem: if data is OK it´s made persistent without problems. I data is invalid (for Hibernate Validators rules), instad of getting error messages the application throws an exception (wich is sent to the client).

          I`ve tried version 1.1.0 with JBoss installed by means of JEMS installer 1.2.0.BETA3.

          Tomorrow I´ll try 1.1.6 but I´m not very comfident because source codes are almost identical.

          Best regards.

          • 2. Re: Validation issue in adapted Registration example
            gavin.king

            It works perfectly fine for me (todays CVS).

            • 3. Re: Validation issue in adapted Registration example
              chopin

              I have done the tests with Seam 1.1.6 using JBoss 4.0.5 patched with JAXB 2.1.

              Now, everything is working fine using Seam 1.1.7RC1.

              Thank you for your replies.

              • 4. Re: Validation issue in adapted Registration example

                Following your comments I made a few more tests using the same JBoss installation and Seam 1.1.6: Everything workd fine.

                There are a couple differences between Registration versions (a couple tags missing and declaring Log as static) that are not related with the validation problem. The main problem is that jboss-seam-registration.war generated by version 1.1.0 does not contain jboss-seam-ui.jar in WEB-INF directoy.

                Thanks a lot gentlemen!