This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 8cd6bcd901 Add Java 28 support for JSP compilation (if JDT supports it)
8cd6bcd901 is described below
commit 8cd6bcd90125bd7653e5af5e51f7b3a1c48b40d4
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 4cdd94d00e..5ba7b44dc4 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -349,6 +349,11 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
// Tomcat. 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_17);
@@ -443,6 +448,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_17);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 88a60876aa..ce2f7ab812 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -172,6 +172,13 @@
<code>doEndTag()</code> were incorrectly re-used. This fix prevents tags
from being re-used if such an exception occurs. (markt)
</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.