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");