• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Error page - stack trace highlighting

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic