• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Exception Bounces Me to Tomcat Error Page

 
Lou Pelagalli
Ranch Hand
Posts: 150
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

An exception in struts, for example a NullPointerException, will bounce me out to the default Tomcat Error page.

Is there a way to instead show an error page of my own design?

Thanks You in Advance for Your Help,

Lou
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could add a global exception handler, for example.
 
Lou Pelagalli
Ranch Hand
Posts: 150
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lasse,

That works great, thank you!

Unfortunately it works too well.

The exception message and stack trace are not sent to the console.

Any suggestions on how to get the exception message and stack trace to the console AND show the error page of my own design?

Thanks,

Lou
 
Lou Pelagalli
Ranch Hand
Posts: 150
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lasse,

I found more information on your suggestion. I was able to show the user-friendly page and send the exception message and stack trace to the console.

This is the solution I ended up using.

http://www.onjava.com/pub/a/onjava/2002/10/30/jakarta.html

Scroll down to Customizing the Exception Handler.

Thanks,

Lou
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting the link!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic