2 Replies Latest reply on May 19, 2009 12:40 AM by israel.bgf

    Exceptions and Messages

    israel.bgf

      Is there any way to catch an exception and instead doing a redirect just swallow it, and add a facesMessage?


      I'm asking that to do something refreshless with ajax and using Seam exception handling. Somethin like user clicking in a button (ajax submit), and if an error happens it just add a facesMessage and reRender (using richfaces) the rich:messages component.


      Is that possible?


      Thanks.


      Israel

        • 1. Re: Exceptions and Messages
          gonorrhea

          from Practical RF book:


          Displaying an error message is a common task, so the RichFaces team built a component that
          basically combines <a4j:outputPanel ajaxRendered="true"> and <h:message> (or <h:messages>).
          The component is called <rich:message> (or <rich:messages>). What this means is that this
          component will always be updated without you having to rerender it or put it inside a placeholder.

          • 2. Re: Exceptions and Messages
            israel.bgf

            I know about this component. The problem is: I want to use Seam Page's Exception Handling, in an AJAX way. The pages.xml does a redirect when a exception is throw, i want to add a facesMessage when an exception is throw without a redirect.


            I think that's not possible indeed. But i need an confirmation.


            Thks in advance,


            Israel