public final class HttpUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
appendAttribute(StringBuilder sb,
String name,
String value) |
static void |
appendAttribute(StringBuilder sb,
String name,
String value,
boolean suppressIfEmpty) |
static String |
appendDefaultPageIfRequired(String url) |
static String |
createPathFromUri(String uri,
int level) |
static javax.servlet.http.Cookie |
findCookieByName(String name) |
static String |
getContentTypeByExtension(String url)
Returns the content type string to be used in the response based on the
extension of an url.
|
protected static String |
getContextPath(javax.servlet.http.HttpServletRequest request) |
static javax.servlet.http.HttpServletRequest |
getCurrentRequest() |
static javax.servlet.ServletContext |
getCurrentServletContext() |
static String |
getCurrentURL(javax.servlet.http.HttpServletRequest request,
boolean stripContextPath) |
static String |
getFullUrl(javax.servlet.http.HttpServletRequest request,
String location,
boolean stripContextPath) |
static String |
getOriginalFullUrl(javax.servlet.http.HttpServletRequest request,
boolean stripContextPath) |
static String |
getOriginalUri(javax.servlet.http.HttpServletRequest request) |
static String |
getSessionPreviewToken(javax.servlet.http.HttpServletRequest request) |
static boolean |
isLocalDomainRequest(javax.servlet.http.HttpServletRequest request) |
static String |
normalizeUrl(String url) |
static List<org.apache.http.NameValuePair> |
parseQueryParams(String queryString)
Parse a query string (e.g.
|
static URI |
parseUri(String uriStr) |
static String |
removeNonAlphaNumeric(String key) |
static String |
replaceNonAlphaNumeric(String key,
String replacement) |
public static javax.servlet.ServletContext getCurrentServletContext()
public static String getOriginalUri(javax.servlet.http.HttpServletRequest request)
public static String getCurrentURL(javax.servlet.http.HttpServletRequest request, boolean stripContextPath)
public static String getOriginalFullUrl(javax.servlet.http.HttpServletRequest request, boolean stripContextPath)
public static String getFullUrl(javax.servlet.http.HttpServletRequest request, String location, boolean stripContextPath)
protected static String getContextPath(javax.servlet.http.HttpServletRequest request)
public static javax.servlet.http.HttpServletRequest getCurrentRequest()
public static boolean isLocalDomainRequest(javax.servlet.http.HttpServletRequest request)
throws UnknownHostException
UnknownHostExceptionpublic static String getContentTypeByExtension(String url)
url - , the url used to detect the content type or mime typepublic static void appendAttribute(StringBuilder sb, String name, String value)
public static void appendAttribute(StringBuilder sb, String name, String value, boolean suppressIfEmpty)
public static List<org.apache.http.NameValuePair> parseQueryParams(String queryString)
"abc=123&cde=456") into a list of name/value pairs.public static javax.servlet.http.Cookie findCookieByName(String name)
public static String getSessionPreviewToken(javax.servlet.http.HttpServletRequest request)
Copyright © 2017. All rights reserved.