larryi 01/01/14 12:45:41
Modified: src/share/org/apache/jasper EmbededServletOptions.java
JspC.java Options.java
src/share/org/apache/jasper/compiler Compiler.java
JavaCompiler.java JikesJavaCompiler.java
SunJavaCompiler.java
src/share/org/apache/jasper/resources messages.properties
messages_es.properties messages_fr.properties
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
1.7 +25 -0
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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- EmbededServletOptions.java 2001/01/07 19:24:12 1.6
+++ EmbededServletOptions.java 2001/01/14 20:45:39 1.7
@@ -1,4 +1,8 @@
/*
+ * $Header:
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/EmbededServletOptions.java,v 1.7
2001/01/14 20:45:39 larryi Exp $
+ * $Revision: 1.7 $
+ * $Date: 2001/01/14 20:45:39 $
+ *
* ====================================================================
*
* The Apache Software License, Version 1.1
@@ -99,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?
*/
@@ -166,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() {
@@ -252,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.19 +9 -0 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.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- JspC.java 2001/01/07 19:24:13 1.18
+++ JspC.java 2001/01/14 20:45:40 1.19
@@ -1,4 +1,8 @@
/*
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v 1.19
2001/01/14 20:45:40 larryi Exp $
+ * $Revision: 1.19 $
+ * $Date: 2001/01/14 20:45:40 $
+ *
* ====================================================================
*
* The Apache Software License, Version 1.1
@@ -169,6 +173,11 @@
return true;
}
+ public boolean getClassDebugInfo() {
+ // compile with debug info
+ return false;
+ }
+
public String getIeClassId() {
return ieClassId;
}
1.13 +9 -0 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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Options.java 2001/01/07 19:24:13 1.12
+++ Options.java 2001/01/14 20:45:40 1.13
@@ -1,4 +1,8 @@
/*
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Options.java,v
1.13 2001/01/14 20:45:40 larryi Exp $
+ * $Revision: 1.13 $
+ * $Date: 2001/01/14 20:45:40 $
+ *
* ====================================================================
*
* The Apache Software License, Version 1.1
@@ -90,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.
*/
1.22 +5 -0
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.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Compiler.java 2001/01/07 19:24:16 1.21
+++ Compiler.java 2001/01/14 20:45:40 1.22
@@ -1,4 +1,8 @@
/*
+ * $Header:
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Compiler.java,v 1.22
2001/01/14 20:45:40 larryi Exp $
+ * $Revision: 1.22 $
+ * $Date: 2001/01/14 20:45:40 $
+ *
* ====================================================================
*
* The Apache Software License, Version 1.1
@@ -261,6 +265,7 @@
classpath + sep + ctxt.getOutputDir());
javac.setOutputDir(ctxt.getOutputDir());
javac.setMsgOutput(out);
+ javac.setClassDebugInfo(ctxt.getOptions().getClassDebugInfo());
/**
* Execute the compiler
1.3 +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.3
diff -u -r1.2 -r1.3
--- JavaCompiler.java 2000/01/21 04:17:21 1.2
+++ JavaCompiler.java 2001/01/14 20:45:40 1.3
@@ -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.3
2001/01/14 20:45:40 larryi Exp $
+ * $Revision: 1.3 $
+ * $Date: 2001/01/14 20:45:40 $
*
* ====================================================================
*
@@ -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.7 +32 -11
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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- JikesJavaCompiler.java 2000/09/01 17:09:49 1.6
+++ JikesJavaCompiler.java 2001/01/14 20:45:40 1.7
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java,v
1.6 2000/09/01 17:09:49 pierred Exp $
- * $Revision: 1.6 $
- * $Date: 2000/09/01 17:09:49 $
+ * $Header:
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java,v
1.7 2001/01/14 20:45:40 larryi Exp $
+ * $Revision: 1.7 $
+ * $Date: 2001/01/14 20:45:40 $
*
* ====================================================================
*
@@ -91,6 +91,7 @@
String compilerPath = "jikes";
String outdir;
OutputStream out;
+ boolean classDebugInfo=false;
/**
* Specify where the compiler can be found
@@ -127,6 +128,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
@@ -151,14 +159,27 @@
}
}
- String[] compilerCmd = new String[] {
- "\"" + compilerPath + "\"",
- //XXX - add encoding once Jikes supports it
- "-classpath", "\"" + classpath + MicrosoftClasspath + "\"",
- "-d", "\"" + outdir + "\"",
- "-nowarn",
- "\"" + source + "\""
- };
+ String[] compilerCmd;
+ if (classDebugInfo) {
+ compilerCmd = new String[] {
+ "\"" + compilerPath + "\"",
+ "-g",
+ //XXX - add encoding once Jikes supports it
+ "-classpath", "\"" + classpath + MicrosoftClasspath + "\"",
+ "-d", "\"" + outdir + "\"",
+ "-nowarn",
+ "\"" + source + "\""
+ };
+ } else {
+ compilerCmd = new String[] {
+ "\"" + compilerPath + "\"",
+ //XXX - add encoding once Jikes supports it
+ "-classpath", "\"" + classpath + MicrosoftClasspath + "\"",
+ "-d", "\"" + outdir + "\"",
+ "-nowarn",
+ "\"" + source + "\""
+ };
+ }
ByteArrayOutputStream tmpErr = new
ByteArrayOutputStream(OUTPUT_BUFFER_SIZE);
try {
1.3 +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.3
diff -u -r1.2 -r1.3
--- SunJavaCompiler.java 2000/01/21 04:17:22 1.2
+++ SunJavaCompiler.java 2001/01/14 20:45:40 1.3
@@ -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.3 2001/01/14 20:45:40 larryi Exp $
+ * $Revision: 1.3 $
+ * $Date: 2001/01/14 20:45:40 $
*
* ====================================================================
*
@@ -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);
}
1.24 +2 -0
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.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- messages.properties 2001/01/07 19:24:24 1.23
+++ messages.properties 2001/01/14 20:45:40 1.24
@@ -1,3 +1,4 @@
+# $Id: messages.properties,v 1.24 2001/01/14 20:45:40 larryi Exp $
#
# Default localized string information
# Localized this the Default Locale as is en_US
@@ -112,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.9 +2 -0
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.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- messages_es.properties 2001/01/07 19:24:25 1.8
+++ messages_es.properties 2001/01/14 20:45:41 1.9
@@ -1,3 +1,4 @@
+# $Id: messages_es.properties,v 1.9 2001/01/14 20:45:41 larryi Exp $
#
# Default localized string information
# Localized para Locale es_ES
@@ -107,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.3 +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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- messages_fr.properties 2001/01/07 19:24:25 1.2
+++ messages_fr.properties 2001/01/14 20:45:41 1.3
@@ -1,4 +1,4 @@
-# $Id: messages_fr.properties,v 1.2 2001/01/07 19:24:25 costin Exp $
+# $Id: messages_fr.properties,v 1.3 2001/01/14 20:45:41 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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]