• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

transfer an exception from EJB to JSP

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
Ranch Hand
Posts: 354
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Diwakar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jack,
Thanks for your valuable response.
 
reply
    Bookmark Topic Watch Topic
  • New Topic