tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Isaacs <Larry.Isa...@sas.com>
Subject A better proposal for compiling JSP's with debugging info
Date Thu, 07 Dec 2000 20:43:49 GMT
Hi,

To add the ability to compile JSP's with debugging information and
achieve more flexible control of Jasper, I propose the following:

For Tomcat 3.2M1

1) Add a "debugInfo" property to Options.java and
   EmbeddedServletOptions.java.  The default value is false.

2) Update EmbeddedServletOptions.java to look for a "debuginfo" servlet
   init parameter to override the default.

3) Update the compiler handling to use the debugInfo property.

For more flexible control of Jasper options:

4) Define a JSP default options string which contains letters which
   associate with the following boolean options in Jasper.

     d = debugInfo
     k = keepGenerated
     l = largeFiles
     m = mappedFile
     s = sendErrorToClient

   If the option letter is preceded by a '+' the option is defaulted true.
   If preceded by a '-' the option is defaulted false.  If not preceded
   by '+' or '-', it is ignored.

5) Update EmbeddedServletOptions.java to look for a default JSP options
   string as a context attribute called "jasper.default.options", or
   maybe "jsp.default.options" (other suggestions?). If the string found,
   the indicated defaults would be set prior to checking for init parameters,
   etc.

6) In Tomcat, add a jspDefaultOptions property to Context.java and
   ContextManager.java.

7) In Tomcat, update DefaultCMSetter.java to look for the jspDefaultOptions
   property on the context, then ContextManager, then a System property called
   "tomcat.jsp.default.options" (again, other suggestions?).  If found, it
   sets the context attribute used by Jasper.

For Tomcat 3.3

In Tomcat 3.3, I could apply the jasper changes for compatibility.  However,
JSP compilation occurs differently.  Instead of using a JSP servlet, it
uses an interceptor that calls Jasper with its own options and then
calls the compiler itself.  Thus, any options string would have to specify
"the" options instead of "default" options.  I think there would be
a benefit to implementing a jspOptions property on Context and
ContextManager, as well as a "tomcat.jsp.options" System property that
override JspInterceptor options.  In addition to providing JSP options
at the context level, it makes it easier to change.  You don't have
to be familiar with the TomcatOptions class and its properties. :-)

For Tomcat 4.0

Regrettably, I haven't yet found the time to get building and testing of
Tomcat 4.0 up and running.  Someone else (Pierre?) could port the changes
as appropriate in a more timely fashion than I could.

Sorry for the long post. Comments?

Larry

P.S. An "Optimized" option could be added, as Craig suggested in an earlier
e-mail. However, current doc for the JDK 1.3 says it is not supported and
recommends not using it in the older compilers.  The Jikes documentation
doesn't support an "optimized" option other than "-O" which means "Do not
generate LineNumberTable attribute". If anyone feels strongly, I could
include this one too.  My inclination is save it for later when it has
better support.

__________
Larry Isaacs		
Larry.Isaacs@sas.com
SAS Institute Inc.


Mime
View raw message