ProAnswers.org

How can I print the stack trace of an exception from a JSP page?

By creating an object of PrintWriter we can print the stack trace in JSP page. Eg:

PrintWriter pw = response.getWriter();

exception.printStackTrace(pw);