diff --git a/pom.xml b/pom.xml index a00e8afdc..fa800b07a 100644 --- a/pom.xml +++ b/pom.xml @@ -46,6 +46,7 @@ UTF-8 1.7.36 + 11 @@ -158,19 +159,19 @@ ${slf4j.version} - javax.servlet - javax.servlet-api - 3.1.0 + jakarta.servlet + jakarta.servlet-api + 6.0.0 - javax.servlet.jsp - javax.servlet.jsp-api - 2.3.3 + jakarta.servlet.jsp + jakarta.servlet.jsp-api + 3.1.1 - javax.el - javax.el-api - 3.0.0 + jakarta.el + jakarta.el-api + 5.0.1 junit diff --git a/velocity-tools-examples/velocity-tools-examples-showcase/pom.xml b/velocity-tools-examples/velocity-tools-examples-showcase/pom.xml index 63b5727a3..b14d41432 100644 --- a/velocity-tools-examples/velocity-tools-examples-showcase/pom.xml +++ b/velocity-tools-examples/velocity-tools-examples-showcase/pom.xml @@ -36,8 +36,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api provided @@ -89,7 +89,7 @@ 1.10.12 - jetty9x + jetty11x diff --git a/velocity-tools-examples/velocity-tools-examples-showcase/src/main/java/org/apache/velocity/tools/examples/showcase/ShowcaseLayoutServlet.java b/velocity-tools-examples/velocity-tools-examples-showcase/src/main/java/org/apache/velocity/tools/examples/showcase/ShowcaseLayoutServlet.java index 6ad3fce17..fa0175872 100644 --- a/velocity-tools-examples/velocity-tools-examples-showcase/src/main/java/org/apache/velocity/tools/examples/showcase/ShowcaseLayoutServlet.java +++ b/velocity-tools-examples/velocity-tools-examples-showcase/src/main/java/org/apache/velocity/tools/examples/showcase/ShowcaseLayoutServlet.java @@ -2,7 +2,7 @@ import org.apache.velocity.tools.view.VelocityLayoutServlet; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; public class ShowcaseLayoutServlet extends VelocityLayoutServlet { diff --git a/velocity-tools-examples/velocity-tools-examples-showcase/src/main/java/org/apache/velocity/tools/examples/showcase/sample/SampleListInitializer.java b/velocity-tools-examples/velocity-tools-examples-showcase/src/main/java/org/apache/velocity/tools/examples/showcase/sample/SampleListInitializer.java index 2001c1631..ef0d4e0b4 100644 --- a/velocity-tools-examples/velocity-tools-examples-showcase/src/main/java/org/apache/velocity/tools/examples/showcase/sample/SampleListInitializer.java +++ b/velocity-tools-examples/velocity-tools-examples-showcase/src/main/java/org/apache/velocity/tools/examples/showcase/sample/SampleListInitializer.java @@ -3,8 +3,8 @@ import java.util.ArrayList; import java.util.List; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; public class SampleListInitializer implements ServletContextListener { diff --git a/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/WEB-INF/web.xml b/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/WEB-INF/web.xml index 59f44aa7a..e29634fdb 100644 --- a/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/WEB-INF/web.xml +++ b/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/WEB-INF/web.xml @@ -19,10 +19,13 @@ under the License. --> - - + + velocity org.apache.velocity.tools.examples.showcase.ShowcaseLayoutServlet diff --git a/velocity-tools-examples/velocity-tools-examples-simple/pom.xml b/velocity-tools-examples/velocity-tools-examples-simple/pom.xml index 2ec465d98..499448c24 100644 --- a/velocity-tools-examples/velocity-tools-examples-simple/pom.xml +++ b/velocity-tools-examples/velocity-tools-examples-simple/pom.xml @@ -36,13 +36,13 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api provided - javax.servlet.jsp - javax.servlet.jsp-api + jakarta.servlet.jsp + jakarta.servlet.jsp-api provided diff --git a/velocity-tools-examples/velocity-tools-examples-simple/src/main/webapp/WEB-INF/web.xml b/velocity-tools-examples/velocity-tools-examples-simple/src/main/webapp/WEB-INF/web.xml index b8f1a3072..078fd4c04 100644 --- a/velocity-tools-examples/velocity-tools-examples-simple/src/main/webapp/WEB-INF/web.xml +++ b/velocity-tools-examples/velocity-tools-examples-simple/src/main/webapp/WEB-INF/web.xml @@ -19,10 +19,13 @@ under the License. --> - - + + velocity org.apache.velocity.tools.view.VelocityViewServlet diff --git a/velocity-tools-view-jsp/pom.xml b/velocity-tools-view-jsp/pom.xml index d3a5b47e9..b64782a7f 100644 --- a/velocity-tools-view-jsp/pom.xml +++ b/velocity-tools-view-jsp/pom.xml @@ -35,18 +35,18 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api provided - javax.servlet.jsp - javax.servlet.jsp-api + jakarta.servlet.jsp + jakarta.servlet.jsp-api provided - javax.el - javax.el-api + jakarta.el + jakarta.el-api provided diff --git a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/JspToolContext.java b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/JspToolContext.java index dcc25c100..8be1dc810 100644 --- a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/JspToolContext.java +++ b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/JspToolContext.java @@ -19,9 +19,9 @@ * under the License. */ -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.jsp.PageContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.jsp.PageContext; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.tools.view.ViewToolContext; diff --git a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/VelocityViewTag.java b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/VelocityViewTag.java index 9067e2ec7..b00abae15 100644 --- a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/VelocityViewTag.java +++ b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/VelocityViewTag.java @@ -21,10 +21,10 @@ import java.io.StringWriter; import java.io.Writer; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.PageContext; -import javax.servlet.jsp.tagext.BodyTagSupport; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.jsp.JspException; +import jakarta.servlet.jsp.PageContext; +import jakarta.servlet.jsp.tagext.BodyTagSupport; import org.apache.velocity.Template; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.runtime.resource.loader.StringResourceLoader; @@ -66,8 +66,8 @@ public class VelocityViewTag extends BodyTagSupport /** * Release any per-invocation resources, resetting any resources or state * that should be cleared between successive invocations of - * {@link javax.servlet.jsp.tagext.Tag#doEndTag()} and - * {@link javax.servlet.jsp.tagext.Tag#doStartTag()}. + * {@link jakarta.servlet.jsp.tagext.Tag#doEndTag()} and + * {@link jakarta.servlet.jsp.tagext.Tag#doStartTag()}. */ protected void reset() { @@ -363,7 +363,7 @@ protected void cache(String name, String template) * Release any per-instance resources, releasing any resources or state * before this tag instance is disposed. * - * @see javax.servlet.jsp.tagext.Tag#release() + * @see jakarta.servlet.jsp.tagext.Tag#release() */ @Override public void release() diff --git a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/ExternalWriterHttpServletResponse.java b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/ExternalWriterHttpServletResponse.java index 0d6196597..9151145ef 100644 --- a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/ExternalWriterHttpServletResponse.java +++ b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/ExternalWriterHttpServletResponse.java @@ -23,8 +23,8 @@ import java.io.PrintWriter; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; /** * Copied from Tiles Request sandbox. diff --git a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/JspUtils.java b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/JspUtils.java index 4a5721e70..94c56afcb 100644 --- a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/JspUtils.java +++ b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/JspUtils.java @@ -21,14 +21,14 @@ import java.io.IOException; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.PageContext; -import javax.servlet.jsp.tagext.BodyContent; -import javax.servlet.jsp.tagext.BodyTag; -import javax.servlet.jsp.tagext.JspTag; -import javax.servlet.jsp.tagext.SimpleTag; -import javax.servlet.jsp.tagext.Tag; -import javax.servlet.jsp.tagext.TagAdapter; +import jakarta.servlet.jsp.JspException; +import jakarta.servlet.jsp.PageContext; +import jakarta.servlet.jsp.tagext.BodyContent; +import jakarta.servlet.jsp.tagext.BodyTag; +import jakarta.servlet.jsp.tagext.JspTag; +import jakarta.servlet.jsp.tagext.SimpleTag; +import jakarta.servlet.jsp.tagext.Tag; +import jakarta.servlet.jsp.tagext.TagAdapter; import org.apache.velocity.context.Context; import org.apache.velocity.context.InternalContextAdapter; diff --git a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/JspWriterImpl.java b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/JspWriterImpl.java index 083a93c01..bea72b9ca 100644 --- a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/JspWriterImpl.java +++ b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/JspWriterImpl.java @@ -20,7 +20,7 @@ import java.io.IOException; import java.io.Writer; -import javax.servlet.jsp.JspWriter; +import jakarta.servlet.jsp.JspWriter; /** * Copied and modified from Tomcat 6.0.x source. diff --git a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityBodyContent.java b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityBodyContent.java index 035885079..d3fe99cc5 100644 --- a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityBodyContent.java +++ b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityBodyContent.java @@ -25,8 +25,8 @@ import java.io.StringWriter; import java.io.Writer; -import javax.servlet.jsp.JspWriter; -import javax.servlet.jsp.tagext.BodyContent; +import jakarta.servlet.jsp.JspWriter; +import jakarta.servlet.jsp.tagext.BodyContent; import org.apache.velocity.context.InternalContextAdapter; import org.apache.velocity.exception.MethodInvocationException; diff --git a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityJspFragment.java b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityJspFragment.java index 0d5e8bd83..11acddf0f 100644 --- a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityJspFragment.java +++ b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityJspFragment.java @@ -22,10 +22,10 @@ import java.io.IOException; import java.io.Writer; -import javax.servlet.jsp.JspContext; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.PageContext; -import javax.servlet.jsp.tagext.JspFragment; +import jakarta.servlet.jsp.JspContext; +import jakarta.servlet.jsp.JspException; +import jakarta.servlet.jsp.PageContext; +import jakarta.servlet.jsp.tagext.JspFragment; import org.apache.velocity.context.InternalContextAdapter; import org.apache.velocity.runtime.parser.node.ASTBlock; diff --git a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityPageContext.java b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityPageContext.java index a67ad859c..8e221d968 100644 --- a/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityPageContext.java +++ b/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityPageContext.java @@ -19,29 +19,30 @@ * under the License. */ +import jakarta.el.ELContext; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.jsp.JspWriter; +import jakarta.servlet.jsp.PageContext; +import jakarta.servlet.jsp.el.ExpressionEvaluator; +import jakarta.servlet.jsp.el.VariableResolver; +import org.apache.velocity.context.Context; +import org.apache.velocity.tools.view.ViewContext; + import java.io.IOException; import java.io.PrintWriter; import java.io.Writer; import java.util.Enumeration; import java.util.NoSuchElementException; -import javax.el.ELContext; -import javax.servlet.RequestDispatcher; -import javax.servlet.Servlet; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.jsp.JspWriter; -import javax.servlet.jsp.PageContext; - -import org.apache.velocity.context.Context; -import org.apache.velocity.tools.view.ViewContext; - /** * Exposes a Velocity {@link Context}, a request and a response as a {@link PageContext}. * @@ -411,16 +412,18 @@ public JspWriter getOut() { @SuppressWarnings("deprecation") @Override - public javax.servlet.jsp.el.ExpressionEvaluator getExpressionEvaluator() { + @Deprecated(forRemoval = true) + public jakarta.servlet.jsp.el.ExpressionEvaluator getExpressionEvaluator() { // Really, who cares? - throw new UnsupportedOperationException("This class works only with JSP 2.1"); + throw new UnsupportedOperationException("This method is removed in jsp api version 4"); } @SuppressWarnings("deprecation") @Override - public javax.servlet.jsp.el.VariableResolver getVariableResolver() { + @Deprecated(forRemoval = true) + public jakarta.servlet.jsp.el.VariableResolver getVariableResolver() { // Really, who cares? - throw new UnsupportedOperationException("This class works only with JSP 2.1"); + throw new UnsupportedOperationException("This method is removed in jsp api version 4"); } @Override diff --git a/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/ExternalWriterHttpServletResponseTest.java b/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/ExternalWriterHttpServletResponseTest.java index 910eba952..33f31c3ba 100644 --- a/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/ExternalWriterHttpServletResponseTest.java +++ b/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/ExternalWriterHttpServletResponseTest.java @@ -29,7 +29,7 @@ import java.io.StringWriter; import java.io.Writer; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Test; diff --git a/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/JspUtilsTest.java b/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/JspUtilsTest.java index ce1eefa6e..88fd0a4a5 100644 --- a/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/JspUtilsTest.java +++ b/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/JspUtilsTest.java @@ -6,14 +6,14 @@ import java.io.IOException; import java.io.StringWriter; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.JspWriter; -import javax.servlet.jsp.PageContext; -import javax.servlet.jsp.tagext.BodyTag; -import javax.servlet.jsp.tagext.JspTag; -import javax.servlet.jsp.tagext.SimpleTag; -import javax.servlet.jsp.tagext.Tag; -import javax.servlet.jsp.tagext.TagAdapter; +import jakarta.servlet.jsp.JspException; +import jakarta.servlet.jsp.JspWriter; +import jakarta.servlet.jsp.PageContext; +import jakarta.servlet.jsp.tagext.BodyTag; +import jakarta.servlet.jsp.tagext.JspTag; +import jakarta.servlet.jsp.tagext.SimpleTag; +import jakarta.servlet.jsp.tagext.Tag; +import jakarta.servlet.jsp.tagext.TagAdapter; import org.apache.velocity.context.Context; import org.apache.velocity.context.InternalContextAdapter; @@ -36,7 +36,7 @@ public class JspUtilsTest private final static String LATEST_TAG_ATTRIBUTE_NAME = "org.apache.velocity.tools.view.jsp.taglib.jspimpl.LATEST_TAG"; /** - * Test method for {@link org.apache.velocity.tools.view.jsp.jspimpl.JspUtils#setLatestTag(org.apache.velocity.context.Context, javax.servlet.jsp.tagext.JspTag)}. + * Test method for {@link org.apache.velocity.tools.view.jsp.jspimpl.JspUtils#setLatestTag(org.apache.velocity.context.Context, jakarta.servlet.jsp.tagext.JspTag)}. */ @Test public void testSetLatestTag() @@ -68,7 +68,7 @@ public void testGetLatestJspTag() } /** - * Test method for {@link org.apache.velocity.tools.view.jsp.jspimpl.JspUtils#wrapTag(javax.servlet.jsp.tagext.JspTag)}. + * Test method for {@link org.apache.velocity.tools.view.jsp.jspimpl.JspUtils#wrapTag(jakarta.servlet.jsp.tagext.JspTag)}. */ @Test public void testWrapTag() @@ -83,7 +83,7 @@ public void testWrapTag() } /** - * Test method for {@link org.apache.velocity.tools.view.jsp.jspimpl.JspUtils#executeSimpleTag(org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node, javax.servlet.jsp.PageContext, javax.servlet.jsp.tagext.SimpleTag)}. + * Test method for {@link org.apache.velocity.tools.view.jsp.jspimpl.JspUtils#executeSimpleTag(org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node, jakarta.servlet.jsp.PageContext, jakarta.servlet.jsp.tagext.SimpleTag)}. * @throws IOException If something goes wrong. * @throws JspException If something goes wrong. */ @@ -106,7 +106,7 @@ public void testExecuteSimpleTag() throws JspException, IOException } /** - * Test method for {@link org.apache.velocity.tools.view.jsp.jspimpl.JspUtils#executeTag(org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node, javax.servlet.jsp.PageContext, javax.servlet.jsp.tagext.Tag)}. + * Test method for {@link org.apache.velocity.tools.view.jsp.jspimpl.JspUtils#executeTag(org.apache.velocity.context.InternalContextAdapter, org.apache.velocity.runtime.parser.node.Node, jakarta.servlet.jsp.PageContext, jakarta.servlet.jsp.tagext.Tag)}. * @throws JspException If something goes wrong. * @throws IOException If something goes wrong. * @throws ParseErrorException If something goes wrong. diff --git a/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityBodyContentTest.java b/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityBodyContentTest.java index 368ad2791..ca443f8ee 100644 --- a/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityBodyContentTest.java +++ b/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityBodyContentTest.java @@ -26,7 +26,7 @@ import java.io.StringWriter; import java.io.Writer; -import javax.servlet.jsp.JspWriter; +import jakarta.servlet.jsp.JspWriter; import org.apache.velocity.context.InternalContextAdapter; import org.apache.velocity.exception.MethodInvocationException; diff --git a/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityJspFragmentTest.java b/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityJspFragmentTest.java index a09895e58..9df6e14a5 100644 --- a/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityJspFragmentTest.java +++ b/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityJspFragmentTest.java @@ -25,8 +25,8 @@ import java.io.IOException; import java.io.Writer; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.PageContext; +import jakarta.servlet.jsp.JspException; +import jakarta.servlet.jsp.PageContext; import org.apache.velocity.context.InternalContextAdapter; import org.apache.velocity.exception.MethodInvocationException; diff --git a/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityPageContextTest.java b/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityPageContextTest.java index 104545cec..0084c70e3 100644 --- a/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityPageContextTest.java +++ b/velocity-tools-view-jsp/src/test/java/org/apache/velocity/tools/view/jsp/jspimpl/VelocityPageContextTest.java @@ -26,13 +26,13 @@ import java.io.Writer; import java.util.Enumeration; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.jsp.PageContext; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.jsp.PageContext; import org.apache.velocity.context.Context; import org.apache.velocity.tools.view.ViewContext; @@ -425,34 +425,6 @@ public void testGetOut() verify(velocityContext, velocityWriter, request, response, servletContext, viewContext); } - /** - * Test method for {@link org.apache.velocity.tools.view.jsp.jspimpl.VelocityPageContext#getExpressionEvaluator()}. - */ - @Test(expected=UnsupportedOperationException.class) - public void testGetExpressionEvaluator() - { - replay(velocityWriter, request, response, servletContext); - try { - pageContext.getExpressionEvaluator(); - } finally { - verify(velocityContext, velocityWriter, request, response, servletContext, viewContext); - } - } - - /** - * Test method for {@link org.apache.velocity.tools.view.jsp.jspimpl.VelocityPageContext#getVariableResolver()}. - */ - @Test(expected=UnsupportedOperationException.class) - public void testGetVariableResolver() - { - replay(velocityWriter, request, response, servletContext); - try { - pageContext.getVariableResolver(); - } finally { - verify(velocityContext, velocityWriter, request, response, servletContext, viewContext); - } - } - /** * Test method for {@link org.apache.velocity.tools.view.jsp.jspimpl.VelocityPageContext#getELContext()}. */ diff --git a/velocity-tools-view/pom.xml b/velocity-tools-view/pom.xml index 76423a527..9be72f54f 100644 --- a/velocity-tools-view/pom.xml +++ b/velocity-tools-view/pom.xml @@ -35,8 +35,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api provided diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/AbstractSearchTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/AbstractSearchTool.java index 5cc7d5c71..2bddc4d13 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/AbstractSearchTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/AbstractSearchTool.java @@ -21,7 +21,7 @@ import java.util.Collections; import java.util.List; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.apache.velocity.tools.Scope; import org.apache.velocity.tools.config.DefaultKey; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/BreadcrumbTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/BreadcrumbTool.java index 38035aeed..581de5470 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/BreadcrumbTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/BreadcrumbTool.java @@ -25,7 +25,7 @@ import org.apache.velocity.tools.generic.LocaleConfig; import org.apache.velocity.tools.generic.ValueParser; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.ArrayList; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/BrowserTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/BrowserTool.java index 9ecb84214..83e330e52 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/BrowserTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/BrowserTool.java @@ -31,7 +31,7 @@ import org.apache.velocity.tools.config.DefaultKey; import org.apache.velocity.tools.config.InvalidScope; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; /** *

Browser sniffing tool (session or request scope requested, session scope advised).

diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/CookieTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/CookieTool.java index 3e6c1f4c3..ad676b29c 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/CookieTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/CookieTool.java @@ -21,9 +21,9 @@ import java.util.ArrayList; import java.util.List; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.velocity.tools.generic.SafeConfig; import org.slf4j.Logger; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/IncludeTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/IncludeTool.java index b9052f438..9b305be8e 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/IncludeTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/IncludeTool.java @@ -22,7 +22,7 @@ import java.io.Serializable; import java.util.Locale; import java.util.Map; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.velocity.tools.Scope; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeConfig.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeConfig.java index acf8d365e..c0430576f 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeConfig.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeConfig.java @@ -20,7 +20,7 @@ */ import java.util.Enumeration; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; /** *

Because sometimes you don't care about the difference between a diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeContextConfig.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeContextConfig.java index 410167919..5598dec78 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeContextConfig.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeContextConfig.java @@ -20,7 +20,7 @@ */ import java.util.Enumeration; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; /** * Implements {@link JeeConfig} with only a {@link ServletContext}. diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeFilterConfig.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeFilterConfig.java index 266e5b501..00e04b20a 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeFilterConfig.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeFilterConfig.java @@ -20,8 +20,8 @@ */ import java.util.Enumeration; -import javax.servlet.FilterConfig; -import javax.servlet.ServletContext; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletContext; /** * Implements {@link JeeConfig} with a {@link FilterConfig}. diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeServletConfig.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeServletConfig.java index 2585eb2d4..f6784d6f3 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeServletConfig.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JeeServletConfig.java @@ -20,8 +20,8 @@ */ import java.util.Enumeration; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; /** * Implements {@link JeeConfig} with a {@link ServletConfig}. diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JsonTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JsonTool.java index ce63c8a7b..17e82f1da 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JsonTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/JsonTool.java @@ -19,7 +19,7 @@ * under the License. */ -import javax.servlet.ServletRequest; +import jakarta.servlet.ServletRequest; import org.apache.velocity.tools.generic.ValueParser; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/LinkTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/LinkTool.java index ba988b61a..cbc49814c 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/LinkTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/LinkTool.java @@ -22,8 +22,8 @@ import java.util.Iterator; import java.util.Map; import java.util.Set; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.velocity.tools.generic.ValueParser; import org.apache.velocity.tools.view.ServletUtils; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/PagerTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/PagerTool.java index 3946fd086..203ba12c3 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/PagerTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/PagerTool.java @@ -22,8 +22,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; import org.apache.velocity.tools.Scope; import org.apache.velocity.tools.config.DefaultKey; import org.apache.velocity.tools.config.InvalidScope; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ParameterTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ParameterTool.java index 7e5dd1106..12c83ec16 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ParameterTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ParameterTool.java @@ -22,7 +22,7 @@ import java.lang.reflect.Array; import java.util.Map; import java.util.HashMap; -import javax.servlet.ServletRequest; +import jakarta.servlet.ServletRequest; import org.apache.velocity.tools.Scope; import org.apache.velocity.tools.config.DefaultKey; import org.apache.velocity.tools.config.ValidScope; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java index 3c9a2c32c..a48d953f0 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java @@ -25,11 +25,12 @@ import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; -import javax.servlet.FilterConfig; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; import org.apache.velocity.tools.ClassUtils; import org.apache.velocity.tools.Toolbox; import org.apache.velocity.tools.config.FactoryConfiguration; @@ -80,9 +81,9 @@ public static String getPath(HttpServletRequest request) // will return the original (wrong) URI requested. The following special // attribute holds the correct path. See section 8.3 of the Servlet // 2.3 specification. - String path = (String)request.getAttribute("javax.servlet.include.servlet_path"); + String path = (String)request.getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH); // also take into account the PathInfo stated on SRV.4.4 Request Path Elements - String info = (String)request.getAttribute("javax.servlet.include.path_info"); + String info = (String)request.getAttribute(RequestDispatcher.INCLUDE_PATH_INFO); if (path == null) { path = request.getServletPath(); diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/UiDependencyTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/UiDependencyTool.java index f06f9da6c..65673fa4c 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/UiDependencyTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/UiDependencyTool.java @@ -26,8 +26,8 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; import org.apache.velocity.tools.generic.SafeConfig; import org.apache.velocity.tools.generic.ValueParser; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java index 3001134f6..bce8e3c6f 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java @@ -21,10 +21,10 @@ import java.io.IOException; import java.io.StringWriter; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.velocity.Template; import org.apache.velocity.context.Context; import org.apache.velocity.exception.MethodInvocationException; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java index cc8859e68..adbe132b6 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java @@ -25,11 +25,11 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Properties; -import javax.servlet.FilterConfig; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.velocity.Template; import org.apache.velocity.app.VelocityEngine; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewFilter.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewFilter.java index 3e3f56822..d4aaefcfb 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewFilter.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewFilter.java @@ -19,14 +19,14 @@ * under the License. */ -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.velocity.context.Context; import org.apache.velocity.tools.Toolbox; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java index 325ab0bba..88dc94329 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java @@ -24,12 +24,12 @@ import java.io.StringWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.slf4j.Logger; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewContext.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewContext.java index 411eeaa66..b048a640b 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewContext.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewContext.java @@ -19,9 +19,9 @@ * under the License. */ -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletContext; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.context.Context; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewContextTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewContextTool.java index bde80ac9b..654c12a47 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewContextTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewContextTool.java @@ -21,9 +21,9 @@ import java.util.Enumeration; import java.util.Set; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import javax.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.ServletContext; import org.apache.velocity.tools.generic.ContextTool; import org.apache.velocity.tools.generic.ValueParser; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewImportSupport.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewImportSupport.java index aa30ae0b6..0008abfa1 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewImportSupport.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewImportSupport.java @@ -33,14 +33,14 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.WriteListener; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.WriteListener; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponseWrapper; import org.apache.velocity.tools.Toolbox; import org.apache.velocity.tools.generic.ImportSupport; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolContext.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolContext.java index 0809ffe4f..f8f5616e5 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolContext.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolContext.java @@ -20,10 +20,10 @@ */ import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.ServletContext; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.context.Context; import org.apache.velocity.tools.ToolContext; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolManager.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolManager.java index 9345c3bd2..f0d479d6f 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolManager.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolManager.java @@ -20,11 +20,11 @@ */ import java.util.Map; -import javax.servlet.ServletContext; -import javax.servlet.ServletRequest; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.HttpServletResponse; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.tools.Scope; import org.apache.velocity.tools.Toolbox; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappResourceLoader.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappResourceLoader.java index e24b63d77..bbe154107 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappResourceLoader.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappResourceLoader.java @@ -25,7 +25,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.HashMap; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.velocity.runtime.resource.Resource; import org.apache.velocity.runtime.resource.loader.ResourceLoader; @@ -67,7 +67,7 @@ public class WebappResourceLoader extends ResourceLoader *
* NOTE: this expects that the ServletContext has already * been placed in the runtime's application attributes - * under its full class name (i.e. "javax.servlet.ServletContext"). + * under its full class name (i.e. "jakarta.servlet.ServletContext"). * * @param configuration the {@link ExtProperties} associated with * this resource loader. diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java index 3baeee288..cc2818a3f 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java @@ -19,9 +19,9 @@ * under the License. */ -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import javax.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.ServletContext; import java.lang.reflect.InvocationTargetException; import org.slf4j.Logger; diff --git a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/XmlTool.java b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/XmlTool.java index 93824a140..40d9eb261 100644 --- a/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/XmlTool.java +++ b/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/XmlTool.java @@ -22,7 +22,7 @@ import org.apache.velocity.tools.XmlUtils; import org.apache.velocity.tools.generic.ValueParser; -import javax.servlet.ServletRequest; +import jakarta.servlet.ServletRequest; /** * View version of {@link org.apache.velocity.tools.generic.XmlTool}. It adds an automatic parsing of the HTTP query diff --git a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/BaseToolTests.java b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/BaseToolTests.java index d92802fe6..80b86df27 100644 --- a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/BaseToolTests.java +++ b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/BaseToolTests.java @@ -22,8 +22,8 @@ import org.apache.velocity.tools.ClassUtils; import org.junit.Assert; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; diff --git a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/CookieToolTests.java b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/CookieToolTests.java index e3af4d14c..194fabd26 100644 --- a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/CookieToolTests.java +++ b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/CookieToolTests.java @@ -25,9 +25,9 @@ import java.util.List; import java.util.Map; import org.apache.velocity.tools.view.CookieTool; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import static org.junit.Assert.*; import org.junit.Test; diff --git a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/JsonToolTests.java b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/JsonToolTests.java index 05d6e06ca..6a3fd7f0d 100644 --- a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/JsonToolTests.java +++ b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/JsonToolTests.java @@ -25,13 +25,13 @@ import org.apache.velocity.tools.view.ViewContext; import org.junit.Test; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; diff --git a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/LinkToolTests.java b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/LinkToolTests.java index 6d21df595..7c8ec43f8 100644 --- a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/LinkToolTests.java +++ b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/LinkToolTests.java @@ -26,8 +26,8 @@ import org.apache.velocity.tools.generic.ValueParser; import org.apache.velocity.tools.view.LinkTool; import org.apache.velocity.tools.view.ViewContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Assert; import org.junit.Test; diff --git a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/RequestAdaptor.java b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/RequestAdaptor.java index beba0bc74..794ab402d 100644 --- a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/RequestAdaptor.java +++ b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/RequestAdaptor.java @@ -19,8 +19,8 @@ * under the License. */ -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; diff --git a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ResponseAdaptor.java b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ResponseAdaptor.java index fdffb8930..e148f11d4 100644 --- a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ResponseAdaptor.java +++ b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ResponseAdaptor.java @@ -19,8 +19,8 @@ * under the License. */ -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletResponse; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.util.HashMap; diff --git a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ServletContextAdaptor.java b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ServletContextAdaptor.java index 86a41cb3b..5f6bdd542 100644 --- a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ServletContextAdaptor.java +++ b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ServletContextAdaptor.java @@ -19,8 +19,8 @@ * under the License. */ -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletContext; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletContext; import java.io.InputStream; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; diff --git a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/XmlToolTests.java b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/XmlToolTests.java index b55cd0593..1cfd0d001 100644 --- a/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/XmlToolTests.java +++ b/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/XmlToolTests.java @@ -23,13 +23,13 @@ import org.apache.velocity.tools.view.XmlTool; import org.junit.Test; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; diff --git a/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/BaseWebappMockTest.java b/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/BaseWebappMockTest.java index 3f5d0aae6..f22baca80 100644 --- a/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/BaseWebappMockTest.java +++ b/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/BaseWebappMockTest.java @@ -7,12 +7,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import static org.easymock.EasyMock.replay; diff --git a/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/VelocityViewTest.java b/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/VelocityViewTest.java index 2a11316c5..7b54167b5 100644 --- a/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/VelocityViewTest.java +++ b/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/VelocityViewTest.java @@ -27,9 +27,10 @@ import java.io.StringWriter; import java.net.URL; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.velocity.Template; import org.apache.velocity.context.Context; @@ -51,7 +52,7 @@ public class VelocityViewTest extends BaseWebappMockTest static Logger logger = LoggerFactory.getLogger(VelocityViewTest.class); /** - * Test method for {@link org.apache.velocity.tools.view.VelocityView#getTemplate(javax.servlet.http.HttpServletRequest)}. + * Test method for {@link org.apache.velocity.tools.view.VelocityView#getTemplate(jakarta.servlet.http.HttpServletRequest)}. * Tests VELTOOLS-119 * @throws IOException If something goes wrong. * @throws MethodInvocationException If something goes wrong. @@ -80,8 +81,8 @@ public void testGetTemplateHttpServletRequestHttpServletResponse() throws Resour expect(config.getInitParameter(VelocityView.TOOLS_KEY)).andAnswer(eval(null)); expect(servletContext.getAttribute(ServletUtils.CONFIGURATION_KEY)).andAnswer(eval((String)null)); expect(servletContext.getResource(VelocityView.USER_TOOLS_PATH)).andAnswer(eval(null)); - expect(request.getAttribute("javax.servlet.include.servlet_path")).andAnswer(eval("/charset-test.vm")); - expect(request.getAttribute("javax.servlet.include.path_info")).andAnswer(eval((String)null)); + expect(request.getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH)).andAnswer(eval("/charset-test.vm")); + expect(request.getAttribute(RequestDispatcher.INCLUDE_PATH_INFO)).andAnswer(eval((String)null)); // This was necessary to verify the bug, now it is not called at all. // expect(response.getCharacterEncoding()).andReturn("ISO-8859-1");