How can I print the stack trace of an Exception out to my JSP page?

Byron Tymvios

To print a stack trace out to your JSP page, you need to wrap the implicit object 'out' in a printWriter and pass the object to the printStackTrace method in Exception. ie:

<% // JSP scriptlet
   // An Exception is thrown
}catch(Exception e){
   e.printStacktrace(new java.io.PrintWriter(out));