Originally posted by Diwakar k:
Hi Everybody,
Using an MVC architecture, I had designed an application. A request from a browser goes to a servlet which invokes an EJB to execute a business logic. In my EJB a have some custom exceptions. Now we know that the outcome of the processing is to be presented using a JSP but prior to this the generated response should be sent to the contoller servlet which in turn invokes a JSP. Now my question is that how do we transfer an exception thrown in an EJB to a JSP page???
Your EJB methods must be throwing your Custom Exceptions,
catch them in your servlet. Include this Exception information as an attribute in HttpRequest object and forward to your JSP. In your JSP, look up request for that Exception attribute.