8 Replies Latest reply on Jan 10, 2012 12:00 AM by Jason Porter

    How to display the custome FacesMessage...

    hantsy bai Master

      I wanted to displayed some FacesMessage in current view due to some business logic validation failure.

      In the before Seam2 application, there is a FacesMessages, when I add an error, it will prevent page redirect and stay on current page. But in JBoss Seam3, I can not use an effective way to postback and display the messages.

      1. I try to threw a Jsf VlidatorException in the code, and I got EJBTransacationException, the whole conversation was stopped.
      I hope the jsf handle this exception, and display the message, but obviously it dose not.


      2. I tried to use Messages(form Seam international), use messages.error to add a messages, but it does not prevent page redirect, and redirect to the target page defined.


      3. I tried to use FacesContext to add an error, facesContext.add(null, new FacesMessage(,,,)), and defined the navigation rule, and use a boolean flag in the Bean class, it can redirect to the current page. But it return to current page by redirect, not post back action, all the values in the form will be disappeared.

      I am using JBoss Seam 3.1.0CR1, JBoss 7.0.1.Final(jsf 2.0.2, due to an Ajax problem, I downgraded the JSF to 2.0.2).

      Any help here? Thanks