This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 838ec11361 Add Java 28 support for JSP compilation (if JDT supports it)
838ec11361 is described below
commit 838ec11361fccb0fd705b7333f38a17727ee093d
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jul 1 14:33:09 2026 +0100
Add Java 28 support for JSP compilation (if JDT supports it)
---
java/org/apache/jasper/compiler/JDTCompiler.java | 11 +++++++++++
webapps/docs/changelog.xml | 7 +++++++
2 files changed, 18 insertions(+)
diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java b/java/org/apache/jasper/compiler/JDTCompiler.java
index 55d46b69a2..ee0725cc70 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -370,6 +370,11 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
// May be supported in a snapshot build.
// This is checked against the actual version below.
settings.put(CompilerOptions.OPTION_Source, "27");
+ } else if (opt.equals("28")) {
+ // 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, "28");
} else {
log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", opt));
settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11);
@@ -485,6 +490,12 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
// This is checked against the actual version below.
settings.put(CompilerOptions.OPTION_TargetPlatform, "27");
settings.put(CompilerOptions.OPTION_Compliance, "27");
+ } else if (opt.equals("28")) {
+ // 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, "28");
+ settings.put(CompilerOptions.OPTION_Compliance, "28");
} else {
log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", opt));
settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 65e7a85557..e91f2816b8 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -175,6 +175,13 @@
<fix>
<bug>70135</bug>: Fix security classload regression. (remm)
</fix>
+ <add>
+ Add support for specifying Java 28 (with the value <code>28</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 be used.
+ (markt)
+ </add>
</changelog>
</subsection>
<subsection name="WebSocket">
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.