Hi Marc,

Hope I can help.  I wrote that chapter and the examples.  Sorry for any
confusion!

So what are you doing?  I just tried those samples again and they work
fine.  

Note that the illegal.jsp is the page you should request, which will
then throw the exception to the exceptInherits.jsp.  The
exceptInherits.jsp is the page that generates the response (e.g.):

JSP Implicit Object: exception

In Tomcat Web Server/3.3 dev ( JSP 1.1; Servlet 2.2 ): 

This particular exception has an inheritance tree of: 

     java.lang.ArithmeticException 
     java.lang.RuntimeException 
     java.lang.Exception 
     java.lang.Throwable 
     java.lang.Object 

Here is the exception thrown in the calling page:

java.lang.ArithmeticException: / by zero


If you request the exceptInherits.jsp _directly_, then you will get a
stack trace in the browser, as you should.  The root exception is a
NullPointer for the implicit "exception" object because no exception has
been thrown, so none exists.  Furthermore, an error page can't act as
its own error page, which is what it sounds like you are attempting.
Does this make sense?

Best regards,

Scott S.




On 14 Jan 2001 23:33:16 -0500, Marc Garrett wrote:
> Yesterday I had simple exception handling working, but today it doesn't
> work. Instead of redirecting it simply reports the error. The page is in the
> same directory.
> 
> The first line of my error-generating page is:
> 
> <%@ page errorPage="exceptInherits.jsp" %>
> 
> This should redirect when it encounters an exception, but it doesn't. Can
> someone assist me? Thank you.
> 
> Marc Garrett
> 
> ----- Original Message -----
> From: "Marc Garrett" <[EMAIL PROTECTED]>
> To: "JRun-Talk" <[EMAIL PROTECTED]>
> Sent: Saturday, January 13, 2001 3:55 PM
> Subject: Re: Exception Handling: Can't redirect
> 
> 
> > Okay, I think I have this resolved. If I have the pages in my wwwroot
> folder
> > I don't get the redirect, but if I have them in a folder that's mapped as
> an
> > application in JRun the exception redirect works.
> >
> > Quiet today other than the exceptionally chatty Fred Moye.
> >
> > Regards,
> >
> > Marc
> >
> > ----- Original Message -----
> > From: "Marc Garrett" <[EMAIL PROTECTED]>
> > To: "JRun-Talk" <[EMAIL PROTECTED]>
> > Sent: Saturday, January 13, 2001 10:03 AM
> > Subject: Exception Handling: Can't redirect
> >
> >
> > > Sorry that this is such a basic question...
> > >
> > > I can't get my error handling in JRun 3 to redirect to an error page.
> > Rather than redirecting when an exception occurs, the JRun server reports
> > the error. I'm using the exception object example from Chapter 4 of Ben
> > Forta's "JSP Application Development" book.
> >
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to