This is an automated email from the ASF dual-hosted git repository. rmaucher pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit e771852e6844983d3569fa28f0daf903952250c5 Author: remm <[email protected]> AuthorDate: Tue Oct 20 00:42:34 2026 +0200 EE and Java compatibility --- java/org/apache/jasper/compiler/SmapUtil.java | 16 ++++++++-- .../apache/jasper/servlet/JspCServletContext.java | 8 +++-- .../jasper/tagplugins/jstl/core/ForEach.java | 12 ++++---- .../jasper/tagplugins/jstl/core/ForTokens.java | 6 ++-- .../apache/jasper/tagplugins/jstl/core/Out.java | 2 +- .../apache/jasper/tagplugins/jstl/core/Set.java | 6 ++-- test/org/apache/jasper/TestJspC.java | 36 +++++++++++++++++----- .../jasper/compiler/TestParserController.java | 24 ++++++++------- test/org/apache/jasper/compiler/TestSmapUtil.java | 6 ++-- .../jasper/servlet/TestJspCServletContext.java | 25 ++++++++++++--- test/org/apache/jasper/servlet/TestTldScanner.java | 4 ++- .../jasper/tagplugins/jstl/core/TestChoose.java | 2 +- .../jasper/tagplugins/jstl/core/TestForEach.java | 2 +- .../jasper/tagplugins/jstl/core/TestForTokens.java | 4 +-- .../jasper/tagplugins/jstl/core/TestImport.java | 2 +- .../jasper/tagplugins/jstl/core/TestOtherwise.java | 2 +- .../jasper/tagplugins/jstl/core/TestUrl.java | 2 +- .../jasper/tagplugins/jstl/core/TestWhen.java | 2 +- test/webapp/jstl/import-target.jsp | 2 +- 19 files changed, 111 insertions(+), 52 deletions(-) diff --git a/java/org/apache/jasper/compiler/SmapUtil.java b/java/org/apache/jasper/compiler/SmapUtil.java index 50424f8fba..ae38984dea 100644 --- a/java/org/apache/jasper/compiler/SmapUtil.java +++ b/java/org/apache/jasper/compiler/SmapUtil.java @@ -16,6 +16,7 @@ */ package org.apache.jasper.compiler; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -770,7 +771,7 @@ public class SmapUtil { try { is = cl.getResourceAsStream(className.replace(".", "/") + ".smap"); if (is != null) { - return new String(is.readAllBytes(), SMAP_ENCODING); + return new String(readFully(is), SMAP_ENCODING); } is = cl.getResourceAsStream(className.replace(".", "/") + ".class"); @@ -787,7 +788,7 @@ public class SmapUtil { // SMAP data is installed as ISO-8859-1 (see installSmap()) // which preserves every byte of the class file, so the marker // cannot be missed by the search below. - String classData = new String(is.readAllBytes(), StandardCharsets.ISO_8859_1); + String classData = new String(readFully(is), StandardCharsets.ISO_8859_1); int index = classData.lastIndexOf(SMAP_START_MARKER); if (index >= 0) { return classData.substring(index + SMAP_START_MARKER.length()); @@ -808,4 +809,15 @@ public class SmapUtil { } return null; } + + private static byte[] readFully(InputStream is) throws IOException { + byte[] buf = new byte[1024]; + try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { + int read; + while ((read = is.read(buf)) >= 0) { + out.write(buf, 0, read); + } + return out.toByteArray(); + } + } } diff --git a/java/org/apache/jasper/servlet/JspCServletContext.java b/java/org/apache/jasper/servlet/JspCServletContext.java index 08de607613..eae3b12ba9 100644 --- a/java/org/apache/jasper/servlet/JspCServletContext.java +++ b/java/org/apache/jasper/servlet/JspCServletContext.java @@ -20,12 +20,12 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -367,7 +367,11 @@ public class JspCServletContext implements ServletContext { // URLEncoder implements form encoding. It uses '+' for a space, // which is not equivalent in a path segment. A literal '+' in the // input is encoded as "%2B", so any '+' in the output is a space. - result.append(URLEncoder.encode(segment, StandardCharsets.UTF_8).replace("+", "%20")); + try { + result.append(URLEncoder.encode(segment, "UTF-8").replace("+", "%20")); + } catch (UnsupportedEncodingException e) { + // Won't happen + } if (slash < 0) { break; } diff --git a/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java b/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java index 57353edcde..2deea93597 100644 --- a/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java +++ b/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java @@ -70,7 +70,7 @@ public final class ForEach implements TagPlugin { ctxt.generateJavaSource(";"); if (hasBegin) { ctxt.generateJavaSource("if (" + beginName + " < 0) {" + - "throw new jakarta.servlet.jsp.JspTagException(\"'begin' < 0\");}"); + "throw new javax.servlet.jsp.JspTagException(\"'begin' < 0\");}"); } String endName = ctxt.getTemporaryVariableName(); @@ -85,7 +85,7 @@ public final class ForEach implements TagPlugin { ctxt.generateJavaSource(";"); if (hasEnd) { ctxt.generateJavaSource("if (" + endName + " < 0) {" + - "throw new jakarta.servlet.jsp.JspTagException(\"'end' < 0\");}"); + "throw new javax.servlet.jsp.JspTagException(\"'end' < 0\");}"); } String stepName = null; @@ -95,7 +95,7 @@ public final class ForEach implements TagPlugin { ctxt.generateAttribute("step"); ctxt.generateJavaSource(";"); ctxt.generateJavaSource("if (" + stepName + " <= 0) {" + - "throw new jakarta.servlet.jsp.JspTagException(\"'step' <= 0\");}"); + "throw new javax.servlet.jsp.JspTagException(\"'step' <= 0\");}"); } ctxt.generateJavaSource("for (int " + index + " = " + beginName + "; " + index + " <= " + endName + ";"); @@ -137,7 +137,7 @@ public final class ForEach implements TagPlugin { ctxt.generateAttribute("begin"); ctxt.generateJavaSource(";"); ctxt.generateJavaSource("if (" + beginV + " < 0) {" + - "throw new jakarta.servlet.jsp.JspTagException(\"'begin' < 0\");}"); + "throw new javax.servlet.jsp.JspTagException(\"'begin' < 0\");}"); } if (hasEnd) { indexV = ctxt.getTemporaryVariableName(); @@ -147,7 +147,7 @@ public final class ForEach implements TagPlugin { ctxt.generateAttribute("end"); ctxt.generateJavaSource(";"); ctxt.generateJavaSource("if (" + endV + " < 0) {" + - "throw new jakarta.servlet.jsp.JspTagException(\"'end' < 0\");}"); + "throw new javax.servlet.jsp.JspTagException(\"'end' < 0\");}"); } if (hasStep) { stepV = ctxt.getTemporaryVariableName(); @@ -155,7 +155,7 @@ public final class ForEach implements TagPlugin { ctxt.generateAttribute("step"); ctxt.generateJavaSource(";"); ctxt.generateJavaSource("if (" + stepV + " <= 0) {" + - "throw new jakarta.servlet.jsp.JspTagException(\"'step' <= 0\");}"); + "throw new javax.servlet.jsp.JspTagException(\"'step' <= 0\");}"); } String iterV = ctxt.getTemporaryVariableName(); diff --git a/java/org/apache/jasper/tagplugins/jstl/core/ForTokens.java b/java/org/apache/jasper/tagplugins/jstl/core/ForTokens.java index 05cd8f8156..cab6412436 100644 --- a/java/org/apache/jasper/tagplugins/jstl/core/ForTokens.java +++ b/java/org/apache/jasper/tagplugins/jstl/core/ForTokens.java @@ -79,7 +79,7 @@ public class ForTokens implements TagPlugin { ctxt.generateAttribute("begin"); ctxt.generateJavaSource(";"); ctxt.generateJavaSource("if (" + beginName + " < 0) {" + - "throw new jakarta.servlet.jsp.JspTagException(\"'begin' < 0\");}"); + "throw new javax.servlet.jsp.JspTagException(\"'begin' < 0\");}"); ctxt.generateJavaSource("for(int " + index + " = 0; " + index + " < " + beginName + " && " + stName + ".hasMoreTokens(); " + index + "++, " + stName + ".nextToken()){}"); } else { @@ -95,7 +95,7 @@ public class ForTokens implements TagPlugin { ctxt.generateAttribute("end"); ctxt.generateJavaSource(";"); ctxt.generateJavaSource("if (" + endSpecifiedName + " < 0) {" + - "throw new jakarta.servlet.jsp.JspTagException(\"'end' < 0\");}"); + "throw new javax.servlet.jsp.JspTagException(\"'end' < 0\");}"); ctxt.generateJavaSource("int " + endName + " = (" + tokensCountName + " - 1) < " + endSpecifiedName + " ? " + tokensCountName + " - 1 : " + endSpecifiedName + ";"); } else { @@ -109,7 +109,7 @@ public class ForTokens implements TagPlugin { ctxt.generateAttribute("step"); ctxt.generateJavaSource(";"); ctxt.generateJavaSource("if (" + stepName + " <= 0) {" + - "throw new jakarta.servlet.jsp.JspTagException(\"'step' <= 0\");}"); + "throw new javax.servlet.jsp.JspTagException(\"'step' <= 0\");}"); } else { ctxt.generateJavaSource("int " + stepName + " = 1;"); } diff --git a/java/org/apache/jasper/tagplugins/jstl/core/Out.java b/java/org/apache/jasper/tagplugins/jstl/core/Out.java index dbf30d802c..c9bb8c09de 100644 --- a/java/org/apache/jasper/tagplugins/jstl/core/Out.java +++ b/java/org/apache/jasper/tagplugins/jstl/core/Out.java @@ -98,7 +98,7 @@ public final class Out implements TagPlugin { // capture is unwound in a finally block, so a failing body does // not leave the output redirected, as the container does when a // buffered tag body throws. - ctxt.generateJavaSource("jakarta.servlet.jsp.tagext.BodyContent " + + ctxt.generateJavaSource("javax.servlet.jsp.tagext.BodyContent " + strBodyContentName + " = _jspx_page_context.pushBody();"); ctxt.generateJavaSource("out = " + strBodyContentName + ";"); ctxt.generateJavaSource("String " + strBodyName + ";"); diff --git a/java/org/apache/jasper/tagplugins/jstl/core/Set.java b/java/org/apache/jasper/tagplugins/jstl/core/Set.java index e732a988bb..44fdcdb133 100644 --- a/java/org/apache/jasper/tagplugins/jstl/core/Set.java +++ b/java/org/apache/jasper/tagplugins/jstl/core/Set.java @@ -16,7 +16,7 @@ */ package org.apache.jasper.tagplugins.jstl.core; -import jakarta.servlet.jsp.PageContext; +import javax.servlet.jsp.PageContext; import org.apache.jasper.compiler.tagplugin.TagPlugin; import org.apache.jasper.compiler.tagplugin.TagPluginContext; @@ -101,10 +101,10 @@ public class Set implements TagPlugin { // exported as a mapping in the variable mapper, as the standard // handler does; only the page scope can hold such a mapping. ctxt.generateJavaSource("if(" + resultName + - " instanceof jakarta.el.ValueExpression) {"); + " instanceof javax.el.ValueExpression) {"); if (iScope == PageContext.PAGE_SCOPE) { ctxt.generateJavaSource(" " + varMapper + ".setVariable(\"" + strVar + - "\", (jakarta.el.ValueExpression) " + resultName + ");"); + "\", (javax.el.ValueExpression) " + resultName + ");"); } else { ctxt.generateJavaSource(" throw new JspTagException(\"Invalid scope for ValueExpression in " + "<set>. \\\"page\\\" scope is required but was \\\"" + strScope + "\\\"\");"); diff --git a/test/org/apache/jasper/TestJspC.java b/test/org/apache/jasper/TestJspC.java index 50df5f928f..0698e6e98b 100644 --- a/test/org/apache/jasper/TestJspC.java +++ b/test/org/apache/jasper/TestJspC.java @@ -112,26 +112,39 @@ public class TestJspC { @Test public void argsNoFullStop() throws Exception { jspc.setArgs(new String[] {"a.jsp", "b.jsp"}); - Assert.assertEquals(List.of("a.jsp", "b.jsp"), jspc.pages); + ArrayList<String> args = new ArrayList<>(); + args.add("a.jsp"); + args.add("b.jsp"); + Assert.assertEquals(args, jspc.pages); } @Test public void argsFullStop() throws Exception { jspc.setArgs(new String[] {"--", "a.jsp", "b.jsp", "c.jsp"}); - Assert.assertEquals(List.of("a.jsp", "b.jsp", "c.jsp"), jspc.pages); + ArrayList<String> args = new ArrayList<>(); + args.add("a.jsp"); + args.add("b.jsp"); + args.add("c.jsp"); + Assert.assertEquals(args, jspc.pages); } @Test public void argsFullStopAfterOptions() throws Exception { jspc.setArgs(new String[] {"-compile", "--", "a.jsp", "b.jsp"}); Assert.assertTrue(jspc.compile); - Assert.assertEquals(List.of("a.jsp", "b.jsp"), jspc.pages); + ArrayList<String> args = new ArrayList<>(); + args.add("a.jsp"); + args.add("b.jsp"); + Assert.assertEquals(args, jspc.pages); } @Test public void argsFullStopFileStartingWithDash() throws Exception { jspc.setArgs(new String[] {"--", "-a.jsp", "b.jsp"}); - Assert.assertEquals(List.of("-a.jsp", "b.jsp"), jspc.pages); + ArrayList<String> args = new ArrayList<>(); + args.add("-a.jsp"); + args.add("b.jsp"); + Assert.assertEquals(args, jspc.pages); } @Test @@ -139,7 +152,10 @@ public class TestJspC { // The full stop argument takes the place of the missing option value // and must not cause the first file argument to be dropped jspc.setArgs(new String[] {"-d", "--", "a.jsp", "b.jsp"}); - Assert.assertEquals(List.of("a.jsp", "b.jsp"), jspc.pages); + ArrayList<String> args = new ArrayList<>(); + args.add("a.jsp"); + args.add("b.jsp"); + Assert.assertEquals(args, jspc.pages); } @Test @@ -147,7 +163,10 @@ public class TestJspC { throws Exception { jspc.setArgs(new String[] {"-cache", "--", "-compile", "a.jsp"}); Assert.assertFalse(jspc.compile); - Assert.assertEquals(List.of("-compile", "a.jsp"), jspc.pages); + ArrayList<String> args = new ArrayList<>(); + args.add("-compile"); + args.add("a.jsp"); + Assert.assertEquals(args, jspc.pages); } @Test @@ -176,7 +195,10 @@ public class TestJspC { // and must not be added to the list of JSP pages jspc.setArgs(new String[] {"-trimSpaces", "--", "a.jsp", "b.jsp"}); Assert.assertEquals(TrimSpacesOption.TRUE, jspc.getTrimSpaces()); - Assert.assertEquals(List.of("a.jsp", "b.jsp"), jspc.pages); + ArrayList<String> args = new ArrayList<>(); + args.add("a.jsp"); + args.add("b.jsp"); + Assert.assertEquals(args, jspc.pages); } @Test diff --git a/test/org/apache/jasper/compiler/TestParserController.java b/test/org/apache/jasper/compiler/TestParserController.java index 09f33c6027..1dcfb4759f 100644 --- a/test/org/apache/jasper/compiler/TestParserController.java +++ b/test/org/apache/jasper/compiler/TestParserController.java @@ -17,8 +17,7 @@ package org.apache.jasper.compiler; import java.io.File; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; +import java.io.FileWriter; import org.junit.Assert; import org.junit.Test; @@ -57,12 +56,14 @@ public class TestParserController extends TomcatBaseTest { // The root element may use any prefix as long as the prefix is bound // to the exact JSP namespace URI - Files.writeString(new File(appDir, "jsp.jsp").toPath(), - "<jsp:root xmlns:jsp=\"" + TagConstants.JSP_URI + "\" version=\"2.0\">\n" + - "<jsp:body>OK</jsp:body>\n</jsp:root>\n", StandardCharsets.UTF_8); - Files.writeString(new File(appDir, "other.jsp").toPath(), - "<mypfx:root xmlns:mypfx=\"" + TagConstants.JSP_URI + "\" version=\"2.0\">\n" + - "<mypfx:body>OK</mypfx:body>\n</mypfx:root>\n", StandardCharsets.UTF_8); + try (FileWriter writer = new FileWriter(new File(appDir, "jsp.jsp"))) { + writer.write("<jsp:root xmlns:jsp=\"" + TagConstants.JSP_URI + "\" version=\"2.0\">\n" + + "<jsp:body>OK</jsp:body>\n</jsp:root>\n"); + } + try (FileWriter writer = new FileWriter(new File(appDir, "other.jsp"))) { + writer.write("<mypfx:root xmlns:mypfx=\"" + TagConstants.JSP_URI + "\" version=\"2.0\">\n" + + "<mypfx:body>OK</mypfx:body>\n</mypfx:root>\n"); + } tomcat.addWebapp(null, "/test", appDir.getAbsolutePath()); tomcat.start(); @@ -88,9 +89,10 @@ public class TestParserController extends TomcatBaseTest { Tomcat tomcat = getTomcatInstance(); File appDir = new File(getTemporaryDirectory(), "root-prefix"); Assert.assertTrue(appDir.mkdirs() || appDir.isDirectory()); - Files.writeString(new File(appDir, "prefix.jsp").toPath(), - "<foo:root xmlns:foo=\"" + TagConstants.JSP_URI + "PageExtra\">\n" + - "<p>hello</p>\n</foo:root>\n", StandardCharsets.UTF_8); + try (FileWriter writer = new FileWriter(new File(appDir, "prefix.jsp"))) { + writer.write("<foo:root xmlns:foo=\"" + TagConstants.JSP_URI + "PageExtra\">\n" + + "<p>hello</p>\n</foo:root>\n"); + } tomcat.addWebapp(null, "/test", appDir.getAbsolutePath()); tomcat.start(); diff --git a/test/org/apache/jasper/compiler/TestSmapUtil.java b/test/org/apache/jasper/compiler/TestSmapUtil.java index 379a5751a9..96c99d4011 100644 --- a/test/org/apache/jasper/compiler/TestSmapUtil.java +++ b/test/org/apache/jasper/compiler/TestSmapUtil.java @@ -17,10 +17,10 @@ package org.apache.jasper.compiler; import java.io.File; +import java.io.FileWriter; import java.net.URL; import java.net.URLClassLoader; import java.nio.charset.StandardCharsets; -import java.nio.file.Files; import org.junit.Assert; import org.junit.Test; @@ -86,7 +86,9 @@ public class TestSmapUtil extends TomcatBaseTest { File file = new File(getTemporaryDirectory(), name + ".class"); String classData = new String(data, StandardCharsets.ISO_8859_1) + SMAP; - Files.writeString(file.toPath(), classData, StandardCharsets.ISO_8859_1); + try (FileWriter writer = new FileWriter(file)) { + writer.write(classData); + } return new URLClassLoader(new URL[] { file.getParentFile().toURI().toURL() }); } diff --git a/test/org/apache/jasper/servlet/TestJspCServletContext.java b/test/org/apache/jasper/servlet/TestJspCServletContext.java index a30e7b4910..fa8f03c3dd 100644 --- a/test/org/apache/jasper/servlet/TestJspCServletContext.java +++ b/test/org/apache/jasper/servlet/TestJspCServletContext.java @@ -16,7 +16,10 @@ */ package org.apache.jasper.servlet; +import java.io.ByteArrayOutputStream; import java.io.File; +import java.io.FileWriter; +import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.nio.charset.StandardCharsets; @@ -147,10 +150,12 @@ public class TestJspCServletContext { // silently reported as not found. File docBase = Files.createTempDirectory("jspc-illegal-chars").toFile(); try { - Files.writeString(new File(docBase, "my file.jsp").toPath(), - "<jsp/>", StandardCharsets.UTF_8); - Files.writeString(new File(docBase, "unicode-\u00fc.jsp").toPath(), - "<jsp/>", StandardCharsets.UTF_8); + try (FileWriter writer = new FileWriter(new File(docBase, "my file.jsp"))) { + writer.write("<jsp/>"); + } + try (FileWriter writer = new FileWriter(new File(docBase, "unicode-\u00fc.jsp"))) { + writer.write("<jsp/>"); + } JspCServletContext context = new JspCServletContext( null, docBase.toURI().toURL(), null, false, false); @@ -158,7 +163,7 @@ public class TestJspCServletContext { Assert.assertNotNull(url); try (InputStream is = url.openStream()) { Assert.assertEquals("<jsp/>", - new String(is.readAllBytes(), StandardCharsets.UTF_8)); + new String(readFully(is), StandardCharsets.UTF_8)); } Assert.assertNotNull(context.getResource("/unicode-\u00fc.jsp")); } finally { @@ -166,6 +171,16 @@ public class TestJspCServletContext { } } + private static byte[] readFully(InputStream is) throws IOException { + byte[] buf = new byte[1024]; + try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { + int read; + while ((read = is.read(buf)) >= 0) { + out.write(buf, 0, read); + } + return out.toByteArray(); + } + } private static void deleteRecursively(File file) { File[] children = file.listFiles(); diff --git a/test/org/apache/jasper/servlet/TestTldScanner.java b/test/org/apache/jasper/servlet/TestTldScanner.java index 8b74db0458..e5b345016d 100644 --- a/test/org/apache/jasper/servlet/TestTldScanner.java +++ b/test/org/apache/jasper/servlet/TestTldScanner.java @@ -194,7 +194,9 @@ public class TestTldScanner extends TomcatBaseTest { " <short-name>example</short-name>\n" + " " + extraElements + "\n" + "</taglib>\n"; - Files.writeString(tld.toPath(), content, StandardCharsets.UTF_8); + try (FileWriter writer = new FileWriter(tld)) { + writer.write(content); + } return new TldResourcePath(tld.toURI().toURL(), "/" + name + "/example.tld"); } diff --git a/test/org/apache/jasper/tagplugins/jstl/core/TestChoose.java b/test/org/apache/jasper/tagplugins/jstl/core/TestChoose.java index 548e963d87..3c7da4763c 100644 --- a/test/org/apache/jasper/tagplugins/jstl/core/TestChoose.java +++ b/test/org/apache/jasper/tagplugins/jstl/core/TestChoose.java @@ -16,7 +16,7 @@ */ package org.apache.jasper.tagplugins.jstl.core; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletResponse; import org.junit.Assert; import org.junit.Test; diff --git a/test/org/apache/jasper/tagplugins/jstl/core/TestForEach.java b/test/org/apache/jasper/tagplugins/jstl/core/TestForEach.java index 6bdcc79154..4aeb793e0e 100644 --- a/test/org/apache/jasper/tagplugins/jstl/core/TestForEach.java +++ b/test/org/apache/jasper/tagplugins/jstl/core/TestForEach.java @@ -106,6 +106,6 @@ public class TestForEach extends AbstractTestTag { Assert.assertEquals(HttpServletResponse.SC_OK, rc); Assert.assertTrue(res.toString(), res.toString() - .contains("jakarta.servlet.jsp.JspTagException: " + message)); + .contains("javax.servlet.jsp.JspTagException: " + message)); } } diff --git a/test/org/apache/jasper/tagplugins/jstl/core/TestForTokens.java b/test/org/apache/jasper/tagplugins/jstl/core/TestForTokens.java index 7c1aa63e44..ce2fcf80e3 100644 --- a/test/org/apache/jasper/tagplugins/jstl/core/TestForTokens.java +++ b/test/org/apache/jasper/tagplugins/jstl/core/TestForTokens.java @@ -16,7 +16,7 @@ */ package org.apache.jasper.tagplugins.jstl.core; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletResponse; import org.junit.Assert; import org.junit.Test; @@ -53,6 +53,6 @@ public class TestForTokens extends AbstractTestTag { Assert.assertEquals(HttpServletResponse.SC_OK, rc); Assert.assertTrue(res.toString(), res.toString() - .contains("jakarta.servlet.jsp.JspTagException: " + message)); + .contains("javax.servlet.jsp.JspTagException: " + message)); } } diff --git a/test/org/apache/jasper/tagplugins/jstl/core/TestImport.java b/test/org/apache/jasper/tagplugins/jstl/core/TestImport.java index 2c59d5ce37..244083de16 100644 --- a/test/org/apache/jasper/tagplugins/jstl/core/TestImport.java +++ b/test/org/apache/jasper/tagplugins/jstl/core/TestImport.java @@ -18,7 +18,7 @@ package org.apache.jasper.tagplugins.jstl.core; import java.io.File; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletResponse; import org.junit.Assert; import org.junit.Test; diff --git a/test/org/apache/jasper/tagplugins/jstl/core/TestOtherwise.java b/test/org/apache/jasper/tagplugins/jstl/core/TestOtherwise.java index 783ab93df2..5a31d599df 100644 --- a/test/org/apache/jasper/tagplugins/jstl/core/TestOtherwise.java +++ b/test/org/apache/jasper/tagplugins/jstl/core/TestOtherwise.java @@ -16,7 +16,7 @@ */ package org.apache.jasper.tagplugins.jstl.core; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletResponse; import org.junit.Assert; import org.junit.Test; diff --git a/test/org/apache/jasper/tagplugins/jstl/core/TestUrl.java b/test/org/apache/jasper/tagplugins/jstl/core/TestUrl.java index 84ca506899..a11862d518 100644 --- a/test/org/apache/jasper/tagplugins/jstl/core/TestUrl.java +++ b/test/org/apache/jasper/tagplugins/jstl/core/TestUrl.java @@ -18,7 +18,7 @@ package org.apache.jasper.tagplugins.jstl.core; import java.io.File; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletResponse; import org.junit.Assert; import org.junit.Test; diff --git a/test/org/apache/jasper/tagplugins/jstl/core/TestWhen.java b/test/org/apache/jasper/tagplugins/jstl/core/TestWhen.java index b64694fc3a..8ffb54c25e 100644 --- a/test/org/apache/jasper/tagplugins/jstl/core/TestWhen.java +++ b/test/org/apache/jasper/tagplugins/jstl/core/TestWhen.java @@ -16,7 +16,7 @@ */ package org.apache.jasper.tagplugins.jstl.core; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletResponse; import org.junit.Assert; import org.junit.Test; diff --git a/test/webapp/jstl/import-target.jsp b/test/webapp/jstl/import-target.jsp index edec2b4b86..aa995cad3b 100644 --- a/test/webapp/jstl/import-target.jsp +++ b/test/webapp/jstl/import-target.jsp @@ -16,4 +16,4 @@ --%> <%@ page session="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> -QS=[${requestScope['jakarta.servlet.include.query_string']}] +QS=[${requestScope['javax.servlet.include.query_string']}] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
