How do you throw EJB/SQL exceptions to front-end/presentation layer ?

Showing Answers 1 - 6 of 6 Answers

Inside the EJB code you put a try catch block. Inside the catch block you throw new EJBException. In the method signature also you declare that the method will thow the exception and not handle it.

At the client side(assuming there is a Front-end/presentation layer), you put the code which invokes an EJB business method inside try catch block and here there will be a matching RemoteException handler. Within the  RemoteException handler you can handle the Exception.

  Was this answer useful?  Yes

raju.k

  • May 4th, 2009
 

In the JSP page we specify an error page for that exception and forward the control to the specified error page when an exception comes and we can display the exception in a good manner.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions