I want to create a Error Page and save the StackTrace within a String type variable

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 %>


0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact