1 Reply Latest reply on Jan 26, 2008 10:12 PM by Matt Drees

    Application-exception handling

    Parragh Szabolcs Newbie

      Hi Seam-Lovers,
      I'm developing a web interface for an old EJB3 application of ours, and wanted to try Seam to do it. So far I love the tool, but now I ran into a trivial thing that I just cannot resolve, and was hoping that you could pont me in the right direction.

      So, we had dozens of session-beans in the application that were called from both a remote client and a small web client (tapestry), too. For the new seam based ui I created pojo action classes to acces those session-beans. With these action classes a new layer had been introduced, but that works for us, because we have to provide the same bl for the remote clients.

      However: those session-beans throw custom, application exceptions that I don't know how to handle within seam. I know there is the xml configured exception handling, but we need a more complex behavior, like specifing that the same page should be re-rendered, and a message should be shown on that etc....

      Actually what we need, is exactly how hibernate-validator exceptions are handled. My problem is, that I don't know how to implement the whole thing, from filters to renderers. I guess I could get hints from the mentioned validator exc. handling, but I cannot find how that is done (I tried, really!).

      So if just someone could tell me where I should look for that in Seam I'd be really grateful!

      Thanks a lot!
      PSz

        • 1. Re: Application-exception handling
          Matt Drees Master

           

          "parszab" wrote:

          So if just someone could tell me where I should look for that in Seam I'd be really grateful!


          Start looking in ui/src/main/java/org.jboss.seam.ui.validator.ModelValidator.java, though the real cool stuff is in src/main/org.jboss.seam.core.Validators.

          It's probably only going to be helpful to you if you're doing field-level validation, but not validating combinations of fields (which I'm guessing is what you're after).

          So, if Seam's exception handling isn't what you need (and, btw, it does handle messages and redirects to the same page. But it'll break the conversation, IIRC, so you shouldn't use it for validation-ish stuff) maybe in your pojo action classes you should catch the appropriate exceptions explicitly and respond appropriately (messages, etc).