Dear All,

In your error page, the variable "exception" is set to the exception
(if any). You can get the error message and stack trace from the
exception like this:

<p>Exception message: <%= (exception == null) ? "" :
exception.getMessage() %></p>
<%
String stStack = "";
if (exception != null) {
        java.io.StringWriter sw = new java.io.StringWriter();
        exception.printStackTrace(new java.io.PrintWriter(sw));
        stStack = sw.toString();
}
%>
<p>Stack trace:</p>
<pre>
<%= stStack %>
</pre>


You can make this even more readable by using the individual stack trace elements instead of the string writer. That way you can give those lines that have your own classes a different colour. What I do is show my own classes in bold red in the stack trace. That way I know what code to check faster.

Check out 
http://java.sun.com/javase/6/docs/api/java/lang/Throwable.html#getStackTrace()
--
Kees Jan

http://java-monitor.com/forum/
[EMAIL PROTECTED]
06-51838192

Rule 1 for being in a hole: stop digging.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to