Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GlobalExceptionHandler prolem

 
Manish Hatwalne
Ranch Hand
Posts: 2591
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a global exception handler configured as follows -



It works as desired (shows nice page to user and puts stack trace in log) when theres an exception Actions, but when there's an exception in the custom RequestProcessor that we have it shows the entire stck trace for wrro 500 in th ebrowser. I wonder why??? How can I take care of that as well? Moreover, are there any other execptions possible whcih will not be caught by this GlobalExceptionHandler?

TIA,
- Manish
 
Sheldon Fernandes
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the struts exception handlers, I think you can only catch exceptions thrown from Action classes. Exceptions could be thrown from JSPs and your request processor class which you will need to handle.

The JSP errors can be handled using the "page" directive isErrorPage and errorPage attributes. You could use try-catch too in your JSP and even in your request processor class. You can also handle exceptions thrown from a servlet in the web.xml by using <exception-type>.

Sheldon Fernandes
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic