1 Reply Latest reply on Jun 25, 2007 12:11 PM by 807605

    how to throw exception from ejb to web tier

    807605
      Hi,
      Can anybody suggest in catching the excepion in struts which is occured in ejb?Can u please send me some code?

      Regards,
      Karimulla
        • 1. Re: how to throw exception from ejb to web tier
          807605
          I dont know Struts.
          We often use JSP in web tier and Java Beans inthe middle tier.

          When a JavaBean throws an exception, inside the catch block, I Throw a new Exception which has to be caught by the JSP (Web tier).

          The code looks like this

          Try{
          }catch(SomeException exception{
          throw new yourException(exception.getMessage() + "\n");
          }

          I mean, we dont treat exceptions inside JavaBeans or Enterprise Java Beans. We designate this task to the Web Tier (JSP pages). I dont know if this helps you even so use it as you wish

          Cya