• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error page - stack trace highlighting  RSS feed

 
Harry Wood
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want my JSP error page to show a stack trace with some intelligent HTML formatting to highlight the important bits. Googling for error page examples, all I can find is basic examples for outputting a plain old stacktrace like this:

So I guess I want to get hold of the each line of the stack trace as a string, and output it line-by-line after adding some HTML decorations. How do I do that with the various java Streams and PrintWriter objects? ...and more to the point... hasn't someone out there done this before??? Know any URLs for advanced example error pages?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66261
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since I never show a stack trace to an end user, I've never felt the need to decorate it.
Check out the StringWriter class to capture the trace into a string.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!