larryi 01/01/11 20:47:00 Modified: src/share/org/apache/jasper Tag: tomcat_32 EmbededServletOptions.java JspC.java Options.java src/share/org/apache/jasper/compiler Tag: tomcat_32 Compiler.java JavaCompiler.java JikesJavaCompiler.java SunJavaCompiler.java src/share/org/apache/jasper/resources Tag: tomcat_32 messages.properties messages_es.properties messages_fr.properties src/share/org/apache/tomcat/request Tag: tomcat_32 JspInterceptor.java Log: Add classDebugInfo property to Options.java and related classes. Update handling so that Jasper can compile classes with debugging information if requested. Revision Changes Path No revision No revision 1.4.2.2 +24 -3 jakarta-tomcat/src/share/org/apache/jasper/EmbededServletOptions.java Index: EmbededServletOptions.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/EmbededServletOptions.java,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- EmbededServletOptions.java 2000/12/22 14:19:10 1.4.2.1 +++ EmbededServletOptions.java 2001/01/12 04:46:58 1.4.2.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/EmbededServletOptions.java,v 1.4.2.1 2000/12/22 14:19:10 pierred Exp $ - * $Revision: 1.4.2.1 $ - * $Date: 2000/12/22 14:19:10 $ + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/EmbededServletOptions.java,v 1.4.2.2 2001/01/12 04:46:58 larryi Exp $ + * $Revision: 1.4.2.2 $ + * $Date: 2001/01/12 04:46:58 $ * * ==================================================================== * @@ -103,6 +103,11 @@ public boolean sendErrorToClient = false; /** + * Do we want to include debugging information in the class file? + */ + public boolean classDebugInfo = false; + + /** * I want to see my generated servlets. Which directory are they * in? */ @@ -170,6 +175,13 @@ } /** + * Should class files be compiled with debug information? + */ + public boolean getClassDebugInfo() { + return classDebugInfo; + } + + /** * Class ID for use in the plugin tag when the browser is IE. */ public String getIeClassId() { @@ -256,6 +268,15 @@ else if (senderr.equalsIgnoreCase("false")) this.sendErrorToClient = false; else Constants.message ("jsp.warning.sendErrToClient", Logger.WARNING); + } + + String debugInfo = config.getInitParameter("classdebuginfo"); + if (debugInfo != null) { + if (debugInfo.equalsIgnoreCase("true")) + this.classDebugInfo = true; + else if (debugInfo.equalsIgnoreCase("false")) + this.classDebugInfo = false; + else Constants.message ("jsp.warning.classDebugInfo", Logger.WARNING); } String ieClassId = config.getInitParameter("ieClassId"); 1.15.2.3 +8 -3 jakarta-tomcat/src/share/org/apache/jasper/JspC.java Index: JspC.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v retrieving revision 1.15.2.2 retrieving revision 1.15.2.3 diff -u -r1.15.2.2 -r1.15.2.3 --- JspC.java 2000/12/22 14:19:10 1.15.2.2 +++ JspC.java 2001/01/12 04:46:58 1.15.2.3 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v 1.15.2.2 2000/12/22 14:19:10 pierred Exp $ - * $Revision: 1.15.2.2 $ - * $Date: 2000/12/22 14:19:10 $ + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v 1.15.2.3 2001/01/12 04:46:58 larryi Exp $ + * $Revision: 1.15.2.3 $ + * $Date: 2001/01/12 04:46:58 $ * * ==================================================================== * @@ -174,6 +174,11 @@ return true; } + public boolean getClassDebugInfo() { + // compile with debug info + return false; + } + public String getIeClassId() { return ieClassId; } 1.11.2.2 +8 -3 jakarta-tomcat/src/share/org/apache/jasper/Options.java Index: Options.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Options.java,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -u -r1.11.2.1 -r1.11.2.2 --- Options.java 2000/12/22 14:19:11 1.11.2.1 +++ Options.java 2001/01/12 04:46:58 1.11.2.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Options.java,v 1.11.2.1 2000/12/22 14:19:11 pierred Exp $ - * $Revision: 1.11.2.1 $ - * $Date: 2000/12/22 14:19:11 $ + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Options.java,v 1.11.2.2 2001/01/12 04:46:58 larryi Exp $ + * $Revision: 1.11.2.2 $ + * $Date: 2001/01/12 04:46:58 $ * * ==================================================================== * @@ -94,6 +94,11 @@ */ public boolean getSendErrorToClient(); + /** + * Should we include debug information in compiled class? + */ + public boolean getClassDebugInfo(); + /** * Class ID for use in the plugin tag when the browser is IE. */ No revision No revision 1.19.2.5 +4 -3 jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java Index: Compiler.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v retrieving revision 1.19.2.4 retrieving revision 1.19.2.5 diff -u -r1.19.2.4 -r1.19.2.5 --- Compiler.java 2001/01/05 18:04:36 1.19.2.4 +++ Compiler.java 2001/01/12 04:46:59 1.19.2.5 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v 1.19.2.4 2001/01/05 18:04:36 marcsaeg Exp $ - * $Revision: 1.19.2.4 $ - * $Date: 2001/01/05 18:04:36 $ + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v 1.19.2.5 2001/01/12 04:46:59 larryi Exp $ + * $Revision: 1.19.2.5 $ + * $Date: 2001/01/12 04:46:59 $ * * ==================================================================== * @@ -265,6 +265,7 @@ classpath + sep + ctxt.getOutputDir()); javac.setOutputDir(ctxt.getOutputDir()); javac.setMsgOutput(out); + javac.setClassDebugInfo(ctxt.getOptions().getClassDebugInfo()); /** * Execute the compiler 1.2.4.1 +8 -3 jakarta-tomcat/src/share/org/apache/jasper/compiler/JavaCompiler.java Index: JavaCompiler.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JavaCompiler.java,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -u -r1.2 -r1.2.4.1 --- JavaCompiler.java 2000/01/21 04:17:21 1.2 +++ JavaCompiler.java 2001/01/12 04:46:59 1.2.4.1 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JavaCompiler.java,v 1.2 2000/01/21 04:17:21 rubys Exp $ - * $Revision: 1.2 $ - * $Date: 2000/01/21 04:17:21 $ + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JavaCompiler.java,v 1.2.4.1 2001/01/12 04:46:59 larryi Exp $ + * $Revision: 1.2.4.1 $ + * $Date: 2001/01/12 04:46:59 $ * * ==================================================================== * @@ -96,6 +96,11 @@ * Set where you want the compiler output (messages) to go */ void setMsgOutput(OutputStream out); + + /** + * Set if you want debugging information in the class file + */ + void setClassDebugInfo(boolean classDebugInfo); /** * Execute the compiler 1.5.2.1 +34 -12 jakarta-tomcat/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java Index: JikesJavaCompiler.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- JikesJavaCompiler.java 2000/06/15 00:26:43 1.5 +++ JikesJavaCompiler.java 2001/01/12 04:46:59 1.5.2.1 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java,v 1.5 2000/06/15 00:26:43 costin Exp $ - * $Revision: 1.5 $ - * $Date: 2000/06/15 00:26:43 $ + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java,v 1.5.2.1 2001/01/12 04:46:59 larryi Exp $ + * $Revision: 1.5.2.1 $ + * $Date: 2001/01/12 04:46:59 $ * * ==================================================================== * @@ -83,6 +83,7 @@ String compilerPath = "jikes"; String outdir; OutputStream out; + boolean classDebugInfo=false; /** * Specify where the compiler can be found @@ -119,6 +120,13 @@ this.out = out; } + /** + * Set if you want debugging information in the class file + */ + public void setClassDebugInfo(boolean classDebugInfo) { + this.classDebugInfo = classDebugInfo; + } + /** * Execute the compiler * @param source - file name of the source to be compiled @@ -126,16 +134,30 @@ public boolean compile(String source) { Process p; int exitValue = -1; + String[] compilerCmd; - String[] compilerCmd = new String[] { - compilerPath, - //XXX - add encoding once Jikes supports it - "-classpath", classpath, - "-d", outdir, - // Only report errors, to be able to test on output in addition to exit code - "-nowarn", - source - }; + if (classDebugInfo) { + compilerCmd = new String[] { + compilerPath, + "-g", + //XXX - add encoding once Jikes supports it + "-classpath", classpath, + "-d", outdir, + // Only report errors, to be able to test on output in addition to exit code + "-nowarn", + source + }; + } else { + compilerCmd = new String[] { + compilerPath, + //XXX - add encoding once Jikes supports it + "-classpath", classpath, + "-d", outdir, + // Only report errors, to be able to test on output in addition to exit code + "-nowarn", + source + }; + } ByteArrayOutputStream tmpErr = new ByteArrayOutputStream(OUTPUT_BUFFER_SIZE); try { 1.2.4.1 +30 -10 jakarta-tomcat/src/share/org/apache/jasper/compiler/SunJavaCompiler.java Index: SunJavaCompiler.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/SunJavaCompiler.java,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -u -r1.2 -r1.2.4.1 --- SunJavaCompiler.java 2000/01/21 04:17:22 1.2 +++ SunJavaCompiler.java 2001/01/12 04:46:59 1.2.4.1 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/SunJavaCompiler.java,v 1.2 2000/01/21 04:17:22 rubys Exp $ - * $Revision: 1.2 $ - * $Date: 2000/01/21 04:17:22 $ + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/SunJavaCompiler.java,v 1.2.4.1 2001/01/12 04:46:59 larryi Exp $ + * $Revision: 1.2.4.1 $ + * $Date: 2001/01/12 04:46:59 $ * * ==================================================================== * @@ -80,6 +80,7 @@ String compilerPath; String outdir; OutputStream out; + boolean classDebugInfo=false; /** * Specify where the compiler can be found @@ -124,16 +125,35 @@ this.out = out; } + /** + * Set if you want debugging information in the class file + */ + public void setClassDebugInfo(boolean classDebugInfo) { + this.classDebugInfo = classDebugInfo; + } + public boolean compile(String source) { Main compiler = new Main(out, "jsp->javac"); + String[] args; - String[] args = new String[] - { - "-encoding", encoding, - "-classpath", classpath, - "-d", outdir, - source - }; + if (classDebugInfo) { + args = new String[] + { + "-g", + "-encoding", encoding, + "-classpath", classpath, + "-d", outdir, + source + }; + } else { + args = new String[] + { + "-encoding", encoding, + "-classpath", classpath, + "-d", outdir, + source + }; + } return compiler.compile(args); } No revision No revision 1.17.2.8 +2 -1 jakarta-tomcat/src/share/org/apache/jasper/resources/messages.properties Index: messages.properties =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/resources/messages.properties,v retrieving revision 1.17.2.7 retrieving revision 1.17.2.8 diff -u -r1.17.2.7 -r1.17.2.8 --- messages.properties 2000/12/22 14:19:13 1.17.2.7 +++ messages.properties 2001/01/12 04:47:00 1.17.2.8 @@ -1,4 +1,4 @@ -# $Id: messages.properties,v 1.17.2.7 2000/12/22 14:19:13 pierred Exp $ +# $Id: messages.properties,v 1.17.2.8 2001/01/12 04:47:00 larryi Exp $ # # Default localized string information # Localized this the Default Locale as is en_US @@ -113,6 +113,7 @@ largeFile. Will use the default value of \"true\" jsp.warning.mappedFile=Warning: Invalid value for the initParam mappedFile. Will use the default value of \"false\" jsp.warning.sendErrToClient=Warning: Invalid value for the initParam sendErrToClient. Will use the default value of \"false\" +jsp.warning.classDebugInfo=Warning: Invalid value for the initParam classDebugInfo. Will use the default value of \"false\" jsp.error.badtaglib=Unable to open taglibrary {0} : {1} jsp.error.badGetReader=Cannot create a reader when the stream is not buffered jsp.warning.unknown.element.in.TLD=Warning: Unknown element {0} in TLD 1.3.2.6 +2 -1 jakarta-tomcat/src/share/org/apache/jasper/resources/messages_es.properties Index: messages_es.properties =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/resources/messages_es.properties,v retrieving revision 1.3.2.5 retrieving revision 1.3.2.6 diff -u -r1.3.2.5 -r1.3.2.6 --- messages_es.properties 2000/11/06 04:08:15 1.3.2.5 +++ messages_es.properties 2001/01/12 04:47:00 1.3.2.6 @@ -1,4 +1,4 @@ -# $Id: messages_es.properties,v 1.3.2.5 2000/11/06 04:08:15 larryi Exp $ +# $Id: messages_es.properties,v 1.3.2.6 2001/01/12 04:47:00 larryi Exp $ # # Default localized string information # Localized para Locale es_ES @@ -108,6 +108,7 @@ jsp.warning.largeFile=Aviso: valor incorrecto para el initParam largeFile. se usara el valor por defecto de \"true\" jsp.warning.mappedFile=Aviso: valor incorrecto para the initParam mappedFile. se usara el valor por defecto de \"false\" jsp.warning.sendErrToClient=Aviso: valor incorrecto para the initParam sendErrToClient. se usara el valor por defecto de \"false\" +jsp.warning.classDebugInfo=Aviso: valor incorrecto para the initParam classDebugInfo. se usara el valor por defecto de \"false\" jsp.error.badtaglib=No se puede abrir la libreria de tags {0} : {1} jsp.error.badGetReader=No se puede crear un reader cuando el stream no tiene buffer jsp.warning.unknown.element.in.TLD=Aviso: Elemento {0} desconocido en el TLD 1.1.2.2 +2 -1 jakarta-tomcat/src/share/org/apache/jasper/resources/messages_fr.properties Index: messages_fr.properties =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/resources/messages_fr.properties,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- messages_fr.properties 2000/12/15 10:58:51 1.1.2.1 +++ messages_fr.properties 2001/01/12 04:47:00 1.1.2.2 @@ -1,4 +1,4 @@ -# $Id: messages_fr.properties,v 1.1.2.1 2000/12/15 10:58:51 hgomez Exp $ +# $Id: messages_fr.properties,v 1.1.2.2 2001/01/12 04:47:00 larryi Exp $ # # Default localized string information # Localized this the Default Locale as is fr_FR @@ -109,6 +109,7 @@ jsp.warning.largeFile=Attention: Valeur invalide pour l''initParam de largeFile. La valeur par défaut \"true\" sera retenue jsp.warning.mappedFile=Attention: Valeur invalide pour l''initParam mappedFile. La valeur par défaut \"false\" sera retenue jsp.warning.sendErrToClient=Attention: Valeur invalide pour l''initParam sendErrToClient. La valeur par défaut \"false\" sera retenue +jsp.warning.classDebugInfo=Attention: Valeur invalide pour l''initParam classDebugInfo. La valeur par défaut \"false\" sera retenue jsp.error.badtaglib=Impossible d''ouvrir la taglibrary {0} : {1} jsp.error.badGetReader=Impossible de créer un lecteur (reader) quand le flux (stream) n''est pas bufferisé jsp.warning.unknown.element.in.TLD=Attention: Element {0} inconnu dans TLD No revision No revision 1.3.2.2 +5 -0 jakarta-tomcat/src/share/org/apache/tomcat/request/Attic/JspInterceptor.java Index: JspInterceptor.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/Attic/JspInterceptor.java,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -r1.3.2.1 -r1.3.2.2 --- JspInterceptor.java 2000/12/22 14:19:14 1.3.2.1 +++ JspInterceptor.java 2001/01/12 04:47:00 1.3.2.2 @@ -470,6 +470,7 @@ public boolean largeFile = false; public boolean mappedFile = false; public boolean sendErrorToClient = false; + public boolean classDebugInfo = false; public String ieClassId = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"; public Class jspCompilerPlugin = null; public String jspCompilerPath = null; @@ -494,6 +495,10 @@ return sendErrorToClient; } + public boolean getClassDebugInfo() { + return classDebugInfo; + } + public String getIeClassId() { return ieClassId; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]