构造器和说明 |
---|
WebUtil() |
限定符和类型 | 方法和说明 |
---|---|
static boolean |
checkEtag(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String ETag)
检查HTTP发过来的信息是否与系统信息相匹配,如果匹配返回304
|
static String |
escape(String src)
java版的escape
|
static String |
flash(javax.servlet.jsp.PageContext pageContext) |
static String |
flash(String resource,
Locale locale) |
static String |
getMessage(javax.servlet.jsp.PageContext pageContext)
获取
saveMessage(String key, Object... params) 保存的的消息,并进行国际化转化 |
static Object |
getObject()
获取
saveObject(Object) 保存的对象 |
static javax.servlet.http.HttpServletRequest |
getRequest() |
static javax.servlet.http.HttpServletResponse |
getResponse() |
static void |
remove() |
static void |
saveAlert(String key,
Object... paramters)
存为alert信息
|
static void |
saveException(BusinessException e)
保存异常,用
getException(PageContext pageContext) 获取 |
static void |
saveJavascript(String javascript) |
static void |
saveMessage(String key,
Object... params)
保存消息,支持国际化 用
getMessage(PageContext pageContext) 获取 |
static void |
saveObject(Object object)
保存对象 用
getObject() 获取 |
static void |
setRequest(javax.servlet.http.HttpServletRequest request) |
static void |
setResponse(javax.servlet.http.HttpServletResponse response) |
static String |
unescape(String src)
java版的unescape
|
static void |
writeETag(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String ETag)
写ETag信息
|
static void |
writeETag(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String ETag,
long cacheDate)
写ETag信息
|
public static void remove()
public static void setRequest(javax.servlet.http.HttpServletRequest request)
public static javax.servlet.http.HttpServletRequest getRequest()
public static void setResponse(javax.servlet.http.HttpServletResponse response)
public static javax.servlet.http.HttpServletResponse getResponse()
public static void saveJavascript(String javascript)
javascript
- javascript片段public static void saveAlert(String key, Object... paramters)
key
- paramters
- public static String flash(javax.servlet.jsp.PageContext pageContext)
public static void saveException(BusinessException e)
getException(PageContext pageContext)
获取e
- public static void saveMessage(String key, Object... params)
getMessage(PageContext pageContext)
获取key
- params
- public static String getMessage(javax.servlet.jsp.PageContext pageContext)
saveMessage(String key, Object... params)
保存的的消息,并进行国际化转化pageContext
- public static void saveObject(Object object)
getObject()
获取object
- public static Object getObject()
saveObject(Object)
保存的对象public static boolean checkEtag(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String ETag) throws IOException
request
- response
- ETag
- true
匹配IOException
public static void writeETag(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String ETag)
request
- response
- ETag
- public static void writeETag(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String ETag, long cacheDate)
request
- response
- ETag
- cacheDate
- 浏览器缓存的时长,单位:秒Copyright © 2016–2017. All rights reserved.