This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new bb1a7f7 Add support for compiling JSPs for Java 18
bb1a7f7 is described below
commit bb1a7f7da9efe67a4046af389e4a5365f394c17a
Author: Mark Thomas <[email protected]>
AuthorDate: Sun Jan 2 16:14:23 2022 +0000
Add support for compiling JSPs for Java 18
---
java/org/apache/jasper/compiler/JDTCompiler.java | 11 ++++++++---
webapps/docs/changelog.xml | 7 +++++++
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 10d80e0..69c6e05 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -312,10 +312,12 @@ public class JDTCompiler extends
org.apache.jasper.compiler.Compiler {
} else if(opt.equals("16")) {
settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_16);
} else if(opt.equals("17")) {
+ settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_17);
+ } else if (opt.equals("18")) {
// Constant not available in latest ECJ version shipped with
// Tomcat. May be supported in a snapshot build.
// This is checked against the actual version below.
- settings.put(CompilerOptions.OPTION_Source, "17");
+ settings.put(CompilerOptions.OPTION_Source, "18");
} else {
log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM",
opt));
settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_1_8);
@@ -375,11 +377,14 @@ public class JDTCompiler extends
org.apache.jasper.compiler.Compiler {
settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_16);
settings.put(CompilerOptions.OPTION_Compliance,
CompilerOptions.VERSION_16);
} else if(opt.equals("17")) {
+ settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_17);
+ settings.put(CompilerOptions.OPTION_Compliance,
CompilerOptions.VERSION_17);
+ } else if (opt.equals("18")) {
// Constant not available in latest ECJ version shipped with
// Tomcat. May be supported in a snapshot build.
// This is checked against the actual version below.
- settings.put(CompilerOptions.OPTION_TargetPlatform, "17");
- settings.put(CompilerOptions.OPTION_Compliance, "17");
+ settings.put(CompilerOptions.OPTION_TargetPlatform, "18");
+ settings.put(CompilerOptions.OPTION_Compliance, "18");
} else {
log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM",
opt));
settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_1_8);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 70f454d..8a895d7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -137,6 +137,13 @@
<code>PropertyNotWritableException</code>s caused by a typo in the name
used for a resource string. (markt)
</fix>
+ <add>
+ Add support for specifying Java 18 (with the value <code>18</code>) as
+ the compiler source and/or compiler target for JSP compilation. If used
+ with an Eclipse JDT compiler version that does not support these
values,
+ a warning will be logged and the default will used.
+ (markt)
+ </add>
</changelog>
</subsection>
<subsection name="WebSocket">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]