public class WebContext extends Object
| 构造器和说明 |
|---|
WebContext() |
| 限定符和类型 | 方法和说明 |
|---|---|
static List<String> |
currentPermissions()
取得当前用户权限
|
static List<Long> |
currentRoles()
取得当前用户角色
|
static Session |
currentSession() |
static SessionUser |
currentUser()
取得当前用户
|
static String |
getActionUri()
取得相对于当前系统actionURI
|
static String |
getBackUrl() |
static String |
getContextPath() |
static String |
getJspPath() |
static javax.servlet.http.HttpServletResponse |
getJspResponse() |
static String |
getRandomFileName(String type,
String ext) |
static String |
getRealPath() |
static javax.servlet.http.HttpServletRequest |
getRequest() |
static byte[] |
getRequestPostBytes(javax.servlet.http.HttpServletRequest request) |
static String |
getRequestPostStr(javax.servlet.http.HttpServletRequest request) |
static javax.servlet.http.HttpServletResponse |
getResponse() |
static String |
getRmoteIp() |
static boolean |
isAjax()
有些问题
|
static String |
realPath2ContextPath(String realPath)
通过真实路径获得上下文路径
|
static String |
realPath2ContextPath2(String realPath) |
static void |
redirect(String action) |
static void |
removeRequest() |
static void |
removeResponse() |
static String |
saveExcel(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)
保存excel对象并返回保存后的文件名
|
static void |
setContextPath(String contextPath) |
static void |
setJspPath(String path) |
static void |
setRealPath(String realPath) |
static void |
setRequest(javax.servlet.http.HttpServletRequest request) |
static void |
setResponse(javax.servlet.http.HttpServletResponse response) |
static void |
toErrorPage(String msg) |
public static void setRequest(javax.servlet.http.HttpServletRequest request)
public static javax.servlet.http.HttpServletRequest getRequest()
public static Session currentSession()
public static void removeRequest()
public static void setResponse(javax.servlet.http.HttpServletResponse response)
public static javax.servlet.http.HttpServletResponse getResponse()
public static javax.servlet.http.HttpServletResponse getJspResponse()
public static void removeResponse()
public static void redirect(String action) throws IOException
IOExceptionpublic static void toErrorPage(String msg)
public static String getRealPath()
public static void setRealPath(String realPath)
public static String getContextPath()
public static void setContextPath(String contextPath)
public static String getRandomFileName(String type, String ext)
ext - 返回一个随机产生指定扩展名的文件名public static String saveExcel(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook) throws IOException
IOExceptionpublic static SessionUser currentUser()
public static boolean isAjax()
public static String getRmoteIp()
public static void setJspPath(String path)
public static String getJspPath()
public static String getBackUrl()
public static byte[] getRequestPostBytes(javax.servlet.http.HttpServletRequest request)
public static String getRequestPostStr(javax.servlet.http.HttpServletRequest request)
public static String getActionUri()
Copyright © 2018. All rights reserved.