yoavs 2004/10/22 10:13:27 Modified: webapps/docs changelog.xml jasper-howto.xml jasper2/src/share/org/apache/jasper EmbeddedServletOptions.java JspC.java Options.java jasper2/src/share/org/apache/jasper/compiler AntCompiler.java Log: Added compilerTargetVM option to Jasper, exposed in JspC, updated relevant documentation. Revision Changes Path 1.148 +3 -0 jakarta-tomcat-catalina/webapps/docs/changelog.xml Index: changelog.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v retrieving revision 1.147 retrieving revision 1.148 diff -u -r1.147 -r1.148 --- changelog.xml 14 Oct 2004 17:32:04 -0000 1.147 +++ changelog.xml 22 Oct 2004 17:13:26 -0000 1.148 @@ -56,6 +56,9 @@ <subsection name="Jasper"> <changelog> + <update> + Exposed compilerSourceVM and compilerTargetVM options to JspC. (yoavs) + </update> </changelog> </subsection> 1.23 +4 -0 jakarta-tomcat-catalina/webapps/docs/jasper-howto.xml Index: jasper-howto.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/jasper-howto.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- jasper-howto.xml 5 Oct 2004 19:48:07 -0000 1.22 +++ jasper-howto.xml 22 Oct 2004 17:13:26 -0000 1.23 @@ -87,6 +87,10 @@ generated servlets? By default the classpath is created dynamically based on the current web application.</li> +<li><strong>compilerSourceVM</strong> - What JDK version are the source files compatible with? (Default JDK 1.4)</li> + +<li><strong>compilerTargetVM</strong> - What JDK version are the generated files compatible with? (Default JDK 1.4)</li> + <li><strong>development</strong> - Is Jasper used in development mode (will check for JSP modification on every access)? <code>true</code> or <code>false</code>, default <code>true</code>.</li> 1.20 +17 -0 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbeddedServletOptions.java Index: EmbeddedServletOptions.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbeddedServletOptions.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- EmbeddedServletOptions.java 20 Oct 2004 00:05:31 -0000 1.19 +++ EmbeddedServletOptions.java 22 Oct 2004 17:13:27 -0000 1.20 @@ -139,6 +139,11 @@ private String compilerTargetVM = "1.4"; /** + * The compiler source VM. + */ + private String compilerSourceVM = "1.4"; + + /** * Cache for the TLD locations */ private TldLocationsCache tldLocationsCache = null; @@ -303,6 +308,13 @@ return compilerTargetVM; } + /** + * @see Options#getCompilerSourceVM + */ + public String getCompilerSourceVM() { + return compilerSourceVM; + } + public boolean getErrorOnUseBeanInvalidClassAttribute() { return errorOnUseBeanInvalidClassAttribute; } @@ -567,6 +579,11 @@ String compilerTargetVM = config.getInitParameter("compilerTargetVM"); if(compilerTargetVM != null) { this.compilerTargetVM = compilerTargetVM; + } + + String compilerSourceVM = config.getInitParameter("compilerSourceVM"); + if(compilerSourceVM != null) { + this.compilerSourceVM = compilerSourceVM; } String javaEncoding = config.getInitParameter("javaEncoding"); 1.87 +22 -2 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java Index: JspC.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- JspC.java 20 Oct 2004 00:05:31 -0000 1.86 +++ JspC.java 22 Oct 2004 17:13:27 -0000 1.87 @@ -98,6 +98,8 @@ private static final String SWITCH_CLASS_NAME = "-c"; private static final String SWITCH_FULL_STOP = "--"; private static final String SWITCH_COMPILE = "-compile"; + private static final String SWITCH_SOURCE = "-source"; + private static final String SWITCH_TARGET = "-target"; private static final String SWITCH_URI_BASE = "-uribase"; private static final String SWITCH_URI_ROOT = "-uriroot"; private static final String SWITCH_FILE_WEBAPP = "-webapp"; @@ -146,6 +148,7 @@ private String compiler = null; private String compilerTargetVM = "1.4"; + private String compilerSourceVM = "1.4"; private boolean classDebugInfo = true; private Vector extensions; @@ -277,6 +280,10 @@ } } else if (tok.equals(SWITCH_ENCODING)) { setJavaEncoding(nextArg()); + } else if (tok.equals(SWITCH_SOURCE)) { + setCompilerSourceVM(nextArg()); + } else if (tok.equals(SWITCH_TARGET)) { + setCompilerTargetVM(nextArg()); } else { if (tok.startsWith("-")) { throw new JasperException("Unrecognized option: " + tok + @@ -473,10 +480,24 @@ return compilerTargetVM; } - public void setCompileTargetVM(String vm) { + public void setCompilerTargetVM(String vm) { compilerTargetVM = vm; } + /** + * @see Options#getCompilerSourceVM. + */ + public String getCompilerSourceVM() { + return compilerSourceVM; + } + + /** + * @see Options#getCompilerSourceVM. + */ + public void setCompilerSourceVM(String vm) { + compilerSourceVM = vm; + } + public TldLocationsCache getTldLocationsCache() { return tldLocationsCache; } @@ -1155,5 +1176,4 @@ // pass straight through } } - } 1.27 +6 -1 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java Index: Options.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- Options.java 19 Oct 2004 16:17:34 -0000 1.26 +++ Options.java 22 Oct 2004 17:13:27 -0000 1.27 @@ -112,9 +112,14 @@ public String getCompiler(); /** - * The compiler target VM, e.g. 1.1, 1.2, 1.3, or 1.4. + * The compiler target VM, e.g. 1.1, 1.2, 1.3, 1.4, or 1.5. */ public String getCompilerTargetVM(); + + /** + * Compiler source VM, e.g. 1.3, 1.4, or 1.5. + */ + public String getCompilerSourceVM(); /** * The cache for the location of the TLD's 1.7 +5 -0 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/AntCompiler.java Index: AntCompiler.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/AntCompiler.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- AntCompiler.java 5 Oct 2004 19:06:31 -0000 1.6 +++ AntCompiler.java 22 Oct 2004 17:13:27 -0000 1.7 @@ -194,6 +194,11 @@ javac.setTarget(options.getCompilerTargetVM()); info.append(" compilerTargetVM=" + options.getCompilerTargetVM() + "\n"); } + + if (options.getCompilerSourceVM() != null) { + javac.setSource(options.getCompilerSourceVM()); + info.append(" compilerSourceVM=" + options.getCompilerSourceVM() + "\n"); + } // Build includes path PatternSet.NameEntry includes = javac.createInclude();
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]