public class ServletUtils extends Object
Constructor and Description |
---|
ServletUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
buildContextLocation(javax.servlet.http.HttpServletRequest request,
String... contextRelativePath) |
static String |
getContextLocation(javax.servlet.http.HttpServletRequest request) |
static String |
getParameterValueEqualIgnoreCase(javax.servlet.http.HttpServletRequest request,
String paramname)
Returns a parameter's value by its name ignoring the case.
|
static String |
getRequestLocation(javax.servlet.http.HttpServletRequest request) |
static String |
getRequestLocationIncludingParameter(javax.servlet.http.HttpServletRequest request)
Appends all parameters from the request (also HTTP POST
parameters) to the request location.
|
static String |
getRequestLocationIncludingParameter(javax.servlet.http.HttpServletRequest request,
boolean consumeFORMURLEncodedBody)
Switches between getRequestLocationIncludingQueryParameter and
getRequestLocationIncludingParameter based on the
consumeFORMURLEncodedBody flag.
|
static String |
getRequestLocationIncludingQueryParameter(javax.servlet.http.HttpServletRequest request)
Appends the query parameters to the request location.
|
static String |
getServletLocation(javax.servlet.http.HttpServletRequest request) |
static void |
sendFormPostRedirect(String redirectUrl,
javax.servlet.http.HttpServletResponse response)
Sends a HTML form redirect.
|
static void |
sendFormPostRedirect(String redirectUrl,
javax.servlet.http.HttpServletResponse response,
Map<String,Iterable<String>> params) |
static void |
sendLocationHeaderRedirect(String redirectUrl,
javax.servlet.http.HttpServletResponse response)
Sends a redirect not using the response.sendRedirect method to allow send
Set-Cookie headers.
|
static void |
sendRedirect(String redirectUrl,
javax.servlet.http.HttpServletResponse response)
Initiates redirect based on the length of the redirection URL.
|
public static String getParameterValueEqualIgnoreCase(javax.servlet.http.HttpServletRequest request, String paramname)
request
- the request.paramname
- the paramname.public static String buildContextLocation(javax.servlet.http.HttpServletRequest request, String... contextRelativePath)
public static String getContextLocation(javax.servlet.http.HttpServletRequest request)
public static String getServletLocation(javax.servlet.http.HttpServletRequest request)
public static String getRequestLocation(javax.servlet.http.HttpServletRequest request)
public static String getRequestLocationIncludingParameter(javax.servlet.http.HttpServletRequest request)
public static String getRequestLocationIncludingParameter(javax.servlet.http.HttpServletRequest request, boolean consumeFORMURLEncodedBody)
public static String getRequestLocationIncludingQueryParameter(javax.servlet.http.HttpServletRequest request)
public static void sendLocationHeaderRedirect(String redirectUrl, javax.servlet.http.HttpServletResponse response)
public static void sendRedirect(String redirectUrl, javax.servlet.http.HttpServletResponse response)
public static void sendFormPostRedirect(String redirectUrl, javax.servlet.http.HttpServletResponse response)
Copyright © 2004–2018 52north.org. All rights reserved.