Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

How can I print the stack trace of an exception from a  JSP page?
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.