[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
[Home]
JSP Preprocessor, was: Re: 1.0b2
No need to use a preprocessor for this.
If you make a
static private boolean debug = false/true;
in the code
and surrpound your debug statements by
if(debug) {
...
}
it needs only a simple optimizer to optimize yout if statement
away. Thats because the value of debug can't be changed ...
AFAIK the sun JDK supports that. Just try it ...
Adding a preprocessor on makro basis is not a good idea IMHO.
>One that we'd like to see is some kind of pre-processor for JSP's . . .
>think back to the old days of C and #IFDEF #ENDIF . . .
>
>Justification:
>In our environment, we do our development (and debugging) on the development
>server. Production code gets moved to the (you guessed it) production
>server. If we could include debugging statements in our code, ONLY on the
>development server, life would be wonderful. We currently do things like:
>
><%
> if (Config.isDevelopment) e.printStackTrace (out); // send trace to
>browser
>
> e.printStackTrace (System.err); // always send to error_log
>%>
>
>but we take that comparision performance hit on our production servers. and
>over multiple iterations, that kinda sucks.
>
>I would rather be able to do this:
>
><%
>#IFDEF _DEBUG
> e.printStackTrace (out); // send trace to browser
>#ENDIF
>
> e.printStackTrace (System.err); // always send to error_log
>%>
>
>and _DEBUG (or any other variable) could be defined as an initArg of GNUJSP.
>Obviously, the code between #IFDEF and #ENDIF would only be included in the
>compiled servlet if the variable was defined.
>
>Is there a widespread interest in this? Does this violate the spec? Why is
>the sky blue?
>
>Personally, I think this is a concept that should have been included with
>JAVA, but they never asked me.
>
>lemme know what y'all think. if there is an interest, I'll prolly submit a
>patch.
>
>eric
>
>----- Original Message -----
>From: Yaroslav Faybishenko <yaroslav@cs.berkeley.edu>
>To: <gnujsp@career.gjt.org>
>Sent: Tuesday, August 24, 1999 8:06 PM
>Subject: 1.0b2
>
>
>> Hi,
>>
>> Most of the fixes/changes/patches that have circulated on the list
>> in the last 4 days are now in the 1.0b2 release.
>>
>> Keep in mind that the jar files in lib/ have been renamed to
>> benefit the poor Windows people, who have complained about the extra
>> dots int he filenames. (I don't know whether this change was really
>> needed, but it's easier to change than to argue.)
>>
>> Also, this release was put out in quite a bit of haste, so if things
>> break, don't all complain at once ;) Actually, I am quite happy with
>> the way things are turning out: I've seen more contributions than
>> complaints, so I hope things stay this way...
>>
>> As of b1, the source is in CVS on gjt.org under /java/org/gjt/jsp10
>> The b2 distribution is at www.xcf.berkeley.edu/~yaroslav/gnujsp
>>
>> Yaroslav
>
Ciao,
Carsten Heyl
Carsten Heyl Heyl@NADS.De
NADS - Solutions on Nets http://www.nads.de/
NADS GmbH http://www.pixelboxx.de/
Hildebrandtstr. 4E Tel.: +49 211 933 02-90
D-40215 Duesseldorf Fax.: +49 211 933 02-93
- References:
- Re: 1.0b2
- From: "Eric B. Ridge" <ebr@tcdi.com>