How can I print the stack trace of an exception from a JSP page?
Question:
How can I print the stack trace of an exception from a JSP page?
Question:How can I print the stack trace of an exception from a JSP page?
Answer
To print the stack trace of an exception from a JSP page you will have to use a PrintWriter object instead of usnig JSP out implicit variable.
<%
out.println("<!--");
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
exception.printStackTrace(pw);
out.print(sw);
sw.close();
pw.close();
out.println("-->");
%>
In the above code you have import="java.io.* package.
By:Jalees Date:
How can I print the stack trace of an exception from a JSP page?