----- Original Message -----
From: "ana226888" <[EMAIL PROTECTED]>
To: "JRun discussion (E-mail)" <[EMAIL PROTECTED]>
Sent: Friday, July 21, 2000 9:42 PM
Subject: JSP fails to catch exceptions


> Hey everyone,
>
> I noticed some very strange behavior in the way JRun treats blocks of code
> that are supposed to throw exceptions. For instance, if i have the code:
>
> SomeClass c = SomeOtherClass.getInstance("blah");
>
> which is supposed to throw an exception "SomeException", JRun never
> complains that that code is not in a try/catch block.
>
> I did some investigating and looks like the generated servlet wraps *all*
> code in a try/catch block for you. I think this is kind of lame for a
couple
> of reasons:
> 1) I want to know when the classes I write throw exceptions so i can deal
> with them as I had planned (that's why my classes throw exceptions in the
> first place! :) ).
> 2) This makes my JSP pages entire un-portable. Now i know why i get a
> million compile time errors when I port to JRun 2.3.x or WebLogic, etc.
>
> Is there an option to disable this "feature"? I love JRun 3 so far but
this
> small issue is making me want to switch to Tomcat or Resin.
>
> Thanks!
> --Bill
>
You can wrap these sections up in try catch blocks. One reason why
the service method of your JSP does this catchall is so that the error page
can be called as a result of the exception. Error pages are a much better
way to
handle unexpected problems in your code however you should always
catch and handle exceptions you expect to happen yourself.

Andy Bailey

------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the 
body.

Reply via email to