Class RequestUtil
java.lang.Object
org.apache.catalina.util.RequestUtil
General purpose request parsing and encoding utility methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringBuffergetRequestURL(HttpServletRequest request) Build an appropriate return value forHttpServletRequest.getRequestURL()based on the provided request object.static booleanisSameWebApplication(HttpServletRequest request, URL url) Tests whether the provided URL is for a resource contained within the same web application as the request.static StringstripPathParams(String input, Request request) Strip parameters for given path.
-
Constructor Details
-
RequestUtil
public RequestUtil()Default constructor.
-
-
Method Details
-
getRequestURL
Build an appropriate return value forHttpServletRequest.getRequestURL()based on the provided request object. Note that this will also work for instances ofHttpServletRequestWrapper.- Parameters:
request- The request object for which the URL should be built- Returns:
- The request URL for the given request object
-
stripPathParams
-
isSameWebApplication
Tests whether the provided URL is for a resource contained within the same web application as the request.- Parameters:
request- The request to testurl- The URL to test- Returns:
trueif the provided URL is for a resource contained within the same web application as the request, otherwisefalse
-