public abstract class EWeb extends Object
| 构造器和说明 |
|---|
EWeb() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addCookie(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String domain,
String path,
boolean isHttpOnly,
String name,
String value,
int maxAge) |
static void |
clearCookieByName(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String name)
清除cookie
|
static String |
getContextPath(javax.servlet.http.HttpServletRequest request)
获取应用根路径(格式:http://www.domain.com:8888/app)
|
static javax.servlet.http.Cookie |
getCookieByName(javax.servlet.http.HttpServletRequest request,
String name)
获得cookie
|
static String |
getCookieValueByName(javax.servlet.http.HttpServletRequest request,
String name)
获取cookie的值
|
static String |
getFullUrl(javax.servlet.http.HttpServletRequest request)
获取完整请求路径(含内容路径及请求参数)
|
static String |
getHTMLToString(String sourcestr)
把页面的信息替换成我们想要的信息存放数据库里面
|
static String |
getIpAddr(javax.servlet.http.HttpServletRequest request)
获取客户端IP地址
|
static String |
getParam(javax.servlet.http.HttpServletRequest request,
String name)
获取请求参数
|
static Map<String,String> |
getParamMap(javax.servlet.http.HttpServletRequest request)
获取ParameterMap
|
static String |
getRealIp(javax.servlet.http.HttpServletRequest request)
获得实际的客户端IP地址
|
static String |
getReferer(javax.servlet.http.HttpServletRequest request)
获取请求来源路径
|
static String |
getStringToHTML(String sourcestr)
把数据库里面的信息回显到页面上
|
static String |
HtmltoText(String inputString)
去除HTML代码
|
static boolean |
isAjax(javax.servlet.http.HttpServletRequest request)
判断是否为Ajax请求
|
static void |
outPage(javax.servlet.http.HttpServletResponse response,
byte[] content,
String contentType)
输出servlet文本内容
|
static void |
outPage(javax.servlet.http.HttpServletResponse response,
String content)
输出servlet文本内容
|
static void |
outPage(javax.servlet.http.HttpServletResponse response,
String content,
String contentType)
输出servlet文本内容
|
static Map<String,javax.servlet.http.Cookie> |
readCookieMap(javax.servlet.http.HttpServletRequest request)
获得所有cookie
|
static String |
requestStream(javax.servlet.http.HttpServletRequest request)
请求流转字符串
|
static String |
UrlDecoder(String url)
地址栏参数解码
|
static String |
UrlEncoder(String url)
地址栏参数编码
|
public static String getIpAddr(javax.servlet.http.HttpServletRequest request)
request - public static String getContextPath(javax.servlet.http.HttpServletRequest request)
request - public static String getFullUrl(javax.servlet.http.HttpServletRequest request)
request - public static String getReferer(javax.servlet.http.HttpServletRequest request)
request - public static String getParam(javax.servlet.http.HttpServletRequest request, String name)
request - name - public static Map<String,String> getParamMap(javax.servlet.http.HttpServletRequest request)
request - public static boolean isAjax(javax.servlet.http.HttpServletRequest request)
request - public static void outPage(javax.servlet.http.HttpServletResponse response,
String content)
response - content - contentType - public static void outPage(javax.servlet.http.HttpServletResponse response,
String content,
String contentType)
response - content - contentType - public static void outPage(javax.servlet.http.HttpServletResponse response,
byte[] content,
String contentType)
response - content - contentType - public static String requestStream(javax.servlet.http.HttpServletRequest request)
request - public static void addCookie(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String domain,
String path,
boolean isHttpOnly,
String name,
String value,
int maxAge)
response - domain - 设置cookie所在域path - 设置cookie所在路径isHttpOnly - 是否只读name - cookie的名称value - cookie的值maxAge - cookie存放的时间(以秒为单位,假如存放三天,即3*24*60*60; 如果值为0,cookie将随浏览器关闭而清除)public static String getCookieValueByName(javax.servlet.http.HttpServletRequest request, String name)
request - name - cookie的名称public static void clearCookieByName(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String name)
request - response - name - cookie的名称public static javax.servlet.http.Cookie getCookieByName(javax.servlet.http.HttpServletRequest request,
String name)
request - name - cookie的名称public static Map<String,javax.servlet.http.Cookie> readCookieMap(javax.servlet.http.HttpServletRequest request)
request - public static String getHTMLToString(String sourcestr)
sourcestr - 页面得到的信息public static String getStringToHTML(String sourcestr)
sourcestr - 数据库取得的信息public static String getRealIp(javax.servlet.http.HttpServletRequest request)
request - Copyright © 2020. All rights reserved.