File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes GlobalExceptionHandler prolem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "GlobalExceptionHandler prolem" Watch "GlobalExceptionHandler prolem" New topic

GlobalExceptionHandler prolem

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2591

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?

- Manish
Sheldon Fernandes
Ranch Hand

Joined: Aug 18, 2004
Posts: 157
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
I agree. Here's the link:
subject: GlobalExceptionHandler prolem
It's not a secret anymore!