DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

JSP: Printing Java Stacktraces In JSP Pages

  • submit to reddit
        // This snippet shows how to view java stack traces for exceptions occurring inside jsp files.

  //some code that throws an exception
catch(Exception e){
  // Cannot print using standard out. Cast JSP writer into a print writer.
  e.printStackTrace( new