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


About | Sitemap | Contact
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.