I observe nearly the same with Sun's jspref092:

I also also get a _blank_ page, when there
is a page /sub/page.jsp with <%@ errorpage="/sub/error.jsp">,
the error.jsp is in the 'sub' directory
and I then call http://localhost:8080/sub/page.jsp in my browser.

if I change the declaration in /sub/page.jsp
to <%@ errorpage="error.jsp" %>
but leave the error.jsp file in the 'sub' dir,
it kind of works...

kindof, that is:

if my JSP page throws an Exception, like in
<% if (true) throw new Exception("testwise"); %>
then the errorpage is called and I get the message in my browser.
fine.

but if it happens that the Exception is thrown inside a Bean,
then the Exception is caught by the jsp.JspServlet
and silently eaten - the JSP page continues without any sign!!
oops.

So every Exception that is thrown within JSPs own tags (like
<USERBEAN>..</USERBEAN>, <DISPLAY> etc) is silently suppressed by the
jsp.JspServlet. No use to throw an exception from inside a Bean.

Another thing:

The errorpage seems to be called with a new HttpServletRequest instance. If
the errorpage inspects its request object to report things like the url,
path, query parameters, form parameters and the like (as in snoop.jsp), you
will see that the original values are gone; the Throwable is all you got to
work with. Well, one could use a subclass of Exception to forward the
request object to the errorpage, but I'm not totally sure if that would
work... and wouldn't it be fine if that happend transparently?

bye,
Werner





> -----
> Betreff: Re: AW: exception handeling in JSP
>
> hi,
>   The ERRORPAGE directive is not working for me, i tried using Jrun2.3 and
> throws the Exception intensionally but i got a blank page in
> response, instead of ErrorPage, JRun seems to consume all
> Exception and default to
> null Value for the attributes.
>        also with .92 ref implementation the .java file has
> Errorpage filename correctly set but the control is not reaching
> to the errorpage file(it also defaults to null).
>    has anybody is having working example and willing to share with me??
>     has somebody else seen the same behaviour.
> --Nitesh kumar Neema
> ps: the directive i am using is
>             <%@ ERRORPAGE="error.jsp" %>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to