public class RequestUtil extends Object
| 构造器和说明 |
|---|
RequestUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
decodeURL(String url) |
static void |
deleteCookie(javax.servlet.http.HttpServletResponse response,
javax.servlet.http.Cookie cookie,
String domain,
String path) |
static void |
deleteCookie(javax.servlet.http.HttpServletResponse response,
String name,
String domain,
String path) |
static void |
deleteCookies(javax.servlet.http.HttpServletResponse response,
String[] names,
String domain,
String path)
批量删除某个域名下的cookie
|
static String |
dump(javax.servlet.http.HttpServletRequest request) |
static String |
encodeURL(String url) |
static String |
getClientIpAddress(javax.servlet.http.HttpServletRequest request)
获取Client IP : 此方法能够穿透squid 和 proxy
|
static javax.servlet.http.Cookie |
getCookie(javax.servlet.http.HttpServletRequest request,
String name) |
static String |
getRefer(javax.servlet.http.HttpServletRequest request) |
static String |
getRequestCompleteURL(javax.servlet.http.HttpServletRequest request) |
static boolean |
isAjaxRequest(javax.servlet.http.HttpServletRequest request) |
static void |
main(String[] args) |
static void |
setCacheHeader(javax.servlet.http.HttpServletResponse response,
int cacheAge) |
static void |
setCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value,
int expiry,
String domain,
String path) |
static void |
setNoCacheHeader(javax.servlet.http.HttpServletResponse response) |
public static void setCacheHeader(javax.servlet.http.HttpServletResponse response,
int cacheAge)
response - cacheAge - public static void setNoCacheHeader(javax.servlet.http.HttpServletResponse response)
response - public static String dump(javax.servlet.http.HttpServletRequest request)
request - public static boolean isAjaxRequest(javax.servlet.http.HttpServletRequest request)
request - public static String getRefer(javax.servlet.http.HttpServletRequest request)
request - public static String getRequestCompleteURL(javax.servlet.http.HttpServletRequest request)
request - public static void setCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value,
int expiry,
String domain,
String path)
response - name - value - expiry - domain - path - .public static void deleteCookie(javax.servlet.http.HttpServletResponse response,
String name,
String domain,
String path)
response - name - domain - path - .public static void deleteCookies(javax.servlet.http.HttpServletResponse response,
String[] names,
String domain,
String path)
response - names - domain - path - public static void deleteCookie(javax.servlet.http.HttpServletResponse response,
javax.servlet.http.Cookie cookie,
String domain,
String path)
response - cookie - domain - path - .public static javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest request,
String name)
request - name - public static String getClientIpAddress(javax.servlet.http.HttpServletRequest request)
request - public static void main(String[] args) throws UnsupportedEncodingException
Copyright © 2025. All rights reserved.