-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------

> In the event of a servlet error, I would like a custom error page to
> appear in the browser so that I don't have to keep checking the servlet
> error log during the development process.  Anyone know how to configure
> this?  I'm sure this has been asked before, but I couldn't find the
> answer in the archives or FAQ.

This is one of the reasons why I designed the Dash framework. It essentially
wraps all of your "servlets" into a single servlet. Your "sub servlets"
throw all their exceptions to the top servlet. If you look at the Dash.java
file, you will see that in the doGet() method, it catches all Exceptions and
attempts to display an error screen that contains the stacktrace nicely
printed.

Here is a url for the code:

<http://www.working-dogs.com/dash/cvsweb/index.cgi/dash/Dash.java?rev=1.33&c
ontent-type=text/x-cvsweb-markup>

Here is a url for more information on Dash:

<http://www.working-dogs.com/dash/>

One way to simply catch the exceptions into a String is to do something like
this:

           ByteArrayOutputStream ostr = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(ostr,true));
            String stackTrace = ostr.toString();

-jon


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to