public class BaseController extends Object
| 构造器和说明 |
|---|
BaseController() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
addCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value,
String path,
int expiry)
写入有效期为非永久的cookie
|
protected void |
addCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value,
String path,
int expiry,
boolean httpOnly)
向客户端添加cookie信息,并提供详细的设置参数
|
protected void |
addPermanencyCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value)
写入永久性cookie值
|
protected void |
addPermanencyCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value,
String path) |
protected javax.servlet.http.Cookie |
getCookie(javax.servlet.http.HttpServletRequest request,
String name)
获取cookie
|
protected String |
getCookieValue(javax.servlet.http.HttpServletRequest request,
String name)
获取cookie的字符串值
|
protected <T> T |
getCurrentUser()
获取当前操作用户
|
protected <T> T |
getCurrentUser(javax.servlet.http.HttpServletRequest request)
根据request获取系统当前操作用户
|
protected String |
getMethod(javax.servlet.http.HttpServletRequest request)
获取请求方法类型
|
protected QueryForm |
getQueryForm(javax.servlet.http.HttpServletRequest request)
从request中获取查询条件
|
protected String |
getRealIP()
获取客户端ip
|
protected String |
getRealIP(javax.servlet.http.HttpServletRequest request)
根据指定request获取客户端ip
|
protected javax.servlet.http.HttpServletRequest |
getRequest()
获取request
|
protected javax.servlet.http.HttpServletResponse |
getResponse()
获取response
|
protected UserContext |
getUserContext() |
boolean |
isAjax(javax.servlet.http.HttpServletRequest request)
判断当前请求是否是ajax请求
|
protected boolean |
isDelete(javax.servlet.http.HttpServletRequest request)
判断当前请求是否是delete请求
|
protected boolean |
isGet(javax.servlet.http.HttpServletRequest request)
判断当前请求是否是get请求
|
protected boolean |
isPost(javax.servlet.http.HttpServletRequest request)
判断当前请求是否是post请求
|
protected boolean |
isPut(javax.servlet.http.HttpServletRequest request)
判断当前请求是否是put请求
|
protected javax.servlet.http.HttpServletRequest getRequest()
protected javax.servlet.http.HttpServletResponse getResponse()
protected String getRealIP()
protected String getRealIP(javax.servlet.http.HttpServletRequest request)
request - protected javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest request,
String name)
request - request对象name - cookie名称protected String getCookieValue(javax.servlet.http.HttpServletRequest request, String name)
request - request对象name - cookie名称protected void addPermanencyCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value)
response - response对象name - cookie名称value - cookie值protected void addPermanencyCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value,
String path)
protected void addCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value,
String path,
int expiry)
response - response对象name - cookie名称value - cookie值path - cookie路径expiry - 有效期,单位:秒protected void addCookie(javax.servlet.http.HttpServletResponse response,
String name,
String value,
String path,
int expiry,
boolean httpOnly)
response - 服务端对象name - cookie名称value - cookie值path - cookie文件路径expiry - 有效期,单位秒httpOnly - 指定cookie是否可通过客户端脚本访问protected String getMethod(javax.servlet.http.HttpServletRequest request)
request - request对象protected <T> T getCurrentUser(javax.servlet.http.HttpServletRequest request)
T - request - request对象protected <T> T getCurrentUser()
T - protected UserContext getUserContext()
protected QueryForm getQueryForm(javax.servlet.http.HttpServletRequest request)
request - request对象protected boolean isGet(javax.servlet.http.HttpServletRequest request)
request - protected boolean isPost(javax.servlet.http.HttpServletRequest request)
request - protected boolean isPut(javax.servlet.http.HttpServletRequest request)
request - protected boolean isDelete(javax.servlet.http.HttpServletRequest request)
request - public boolean isAjax(javax.servlet.http.HttpServletRequest request)
request - Copyright © 2016. All rights reserved.