1 Reply Latest reply on Mar 14, 2007 5:19 AM by Pete Muir

    Validating errors in JBoss Seam using FacesMessages

    lara khoury Newbie

      Hi,

      I am using jboss-seam-1.2.0.PATCH1 and I am try to display a message for unique names. I mean I am adding a client and the name should always be unique, I added the following in the ClientHome.java class:

      @Override
       public String persist() {
       try {
       return super.persist();
       }
       catch(Exception e)
       {
       if (e instanceof javax.persistence.EntityExistsException) {
       FacesMessages.instance().add("name", "Client Name should be unique");
       }
       return null;
       }
       }
      



      The problem is that the error is catched and I have no bug in the application but the message is not displayed and I am getting the following on the server:

      ERROR [STDERR] com.sun.faces.lifecycle.RenderResponsePhase execute
      INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
      



      How can I solve this issue?
      Any help is appreciated!

      Best Regards,