Never been to DZone Snippets before?

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

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

JSP: Printing Java stacktraces in JSP pages

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

   1  
   2  
   3  try{
   4    //some code that throws an exception
   5  }
   6  catch(Exception e){
   7    // Cannot print using standard out. Cast JSP writer into a print writer.
   8    e.printStackTrace( new java.io.PrintWriter(out))
   9  }
  10  
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS