Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 70321 invoked from network); 7 Dec 2000 20:44:17 -0000 Received: from merc95.us.sas.com (HELO merc95.na.sas.com) (149.173.6.5) by locus.apache.org with SMTP; 7 Dec 2000 20:44:17 -0000 Received: from merc95.na.sas.com ([127.0.0.1]) by merc95.na.sas.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id YHYGKLXV; Thu, 7 Dec 2000 15:43:50 -0500 Received: from 10.25.12.252 by merc95.na.sas.com (InterScan E-Mail VirusWall NT); Thu, 07 Dec 2000 15:43:50 -0500 (Eastern Standard Time) Received: by MERC91.us.sas.com with Internet Mail Service (5.5.2653.19) id ; Thu, 7 Dec 2000 15:43:45 -0500 Message-ID: <764CA2FF49EC054BA086FC8253A52DD7433279@merc09.us.sas.com> From: Larry Isaacs To: "'tomcat-dev@jakarta.apache.org'" Subject: A better proposal for compiling JSP's with debugging info Date: Thu, 7 Dec 2000 15:43:49 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N 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.