The problem is in Jasper's parsing of the JSP to create the java source code, correct?
The code then gets executed in the same
VM/Classloader as the classes in the contain Webapp's WEB-INF/classes and WEB-INF/lib,
correct?
If so, can this be worked around by wrapping the java assert calls in another class as
follows:
public class JSPAssert {
static void doAssert(boolean invariant, String message) {
assert invariant: message;
}
}
And using JSPAssert.doAssert() within the JSP?
Granted you won't get the full benefits of conditional execution because
JSPAssert.doAssert() will always execute, as will whatever
logic determines the invariant and message.
But it allows you to follow good and consistent coding practices in your JSPs and you
can still switch on/and off the actual
throwing of the assertion exceptions.
- Jeff
----- Original Message -----
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Oliver Jonas" <[EMAIL PROTECTED]>
Cc: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Friday, October 25, 2002 12:20 PM
Subject: RE: JSP's and J2SDK1.4 assert statement
>
>
> On Fri, 25 Oct 2002, Oliver Jonas wrote:
>
> > Date: Fri, 25 Oct 2002 19:28:34 +0200
> > From: Oliver Jonas <[EMAIL PROTECTED]>
> > To: Tomcat Users List <[EMAIL PROTECTED]>
> > Cc: [EMAIL PROTECTED]
> > Subject: RE: JSP's and J2SDK1.4 assert statement
> >
> > Hi Craig,
> >
> > I also tried CATALINA_OPTS... same thing happens. Thinking about it "-source
> > 1.4" isn't actually a valid option for "java", only for "javac". (Maybe
> > that's why it fails because it starts fine if I only put "-enableassertions"
> > in JAVA_OPTS.
> >
> > So I guess I need to tell Jasper to use the option "-source 1.4".
> >
> >
> > Any ideas how to?
> >
>
> Nope ... you'd have to modify Jasper sources to do this.
>
> > Thanks,
> > Oliver.
> >
> > PS: Using JSP's only for HTML presentation... but would still like to have
> > asserts to make sure values returned by the underlying Java API are valid.
> >
>
> Good.
>
>
> --
> To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>