Ugly .. but you can capture exceptions thrown in processRequest(..), and then require the  bean user to call a method to check that the bean initialized properly. Example:
 
<USEBEAN name=mybean ....></USEBEAN>
<%
    mybean.assertOk(); // this can throw an exception and JSP will redirect to error page
%>
 
Not propagating exceptions thrown inside of processRequest(...) to the error page has got to be a bug, right? Perhaps there are some clean up issues that would make exception propagation a burden to implement??
 
Tuyen Tran
[EMAIL PROTECTED]
 
 
 
-----Original Message-----
From: Prasanna <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, April 06, 1999 5:52 AM
Subject: Re: Exceptions in JSP-aware beans

Hi,
 
  I am also facing the same problem. If the exception is thrown at the JSP bean, the "errorpage" directive at JSP doesn't trap this exception.  If exception is thrown by JSP it self  with in <%...%> tags then exception is caught. I am using JRUN 2.3, NT4.0 and MS-IIS. Is this problem specific to JRUN?. How do other servlet engines behave?. How to solve this problem?. Any ideas!
 
Thanks and regards
Prasanna
[EMAIL PROTECTED]
-----Original Message-----
From: Tuyen Tran <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Thursday, April 01, 1999 12:49 AM
Subject: Exceptions in JSP-aware beans

If the processRequest method of a JSP-aware bean throws an exception (say NullPointerException), shoudn't the JSP runtime detect the exception and redirect to an error page? I've tried this with both JRun 2.3 and the Sun 0.92 reference implementation, and they both swallow the exception. The JRun implementation does at least output the stack trace to the log, but shouldn't bean exceptions propagate up the normal error page handling mechanism?? Is this part of the design, or is it a bug?
 
Tuyen Tran
 

Reply via email to