I want to create a Error Page and save the StackTrace within a String type variable
Created May 7, 2012
Christopher Schultz
Instead of basing your PrintWriter
on the out
attribute of the JSP, use a java.io.StringWriter
:
<%
StringWriter sw = new StringWriter();
exception.printStackTrace(new PrintWriter(sw));
%>
Stack trace: <%= sw %>