Jeff,
Quick fix to see the trace on the screen.
In your error page, use:
<%= exception.printStackTrace(new PrintWriter(out)) %>
The printStackTrace method is also implemented to take a PrintWriter
argument as the
Writer to which to print. PrintWriters can be created using other writers,
so this
does work (this is what I used while playing with JSWDK).
-AMT
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Bail . Jeff
> Sent: Thursday, January 27, 2000 9:38 AM
> To: [EMAIL PROTECTED]
> Subject: exception.printStackTrace()
>
>
> Before I add an errorPage parameter to each one of my JSPs, I'd like to be
> sure that I'll still be able to see the stack trace of any exceptions that
> may happen. By default (without setting an errorPage) Orion seems to show
> them, but the jswdk just gives you "Error 500".
>
> I started at
> http://java.sun.com/products/jsp/html/exceptions.fm.html -- on
> this page it says that "exception.printStackTrace() displays the
> exception's
> stack trace. The class name and stack trace are probably very
> helpful to you
> the developer, but probably not very helpful to your user." I'd take this
> to mean that the stack trace is sent to the browser, but when I run the
> example I only see it in the error stream of the java web server.
>
> printStackTrace() can take a java.io.PrintStream, but
> javax.servlet.jsp.JspWriter is extended from Writer, not OutputStream so I
> don't think casting is a solution.
>
> I'd agree with the tutorial that the stack trace is not something that the
> end user is going to want to see, but while I'm developing I'd rather not
> have to do anything extra to see the trace if I'm not running the
> web server
> locally.
>
>
> Thanks for any ideas,
>
> Jeff
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html