public abstract class Mvcs extends Object
限定符和类型 | 字段和说明 |
---|---|
static NutMvcContext |
ctx
已过时。
|
static String |
DEFAULT_MSGS |
static boolean |
DISABLE_X_POWERED_BY |
static boolean |
disableFastClassInvoker |
static boolean |
DISPLAY_METHOD_LINENUMBER |
static String |
LOCALE_KEY |
static String |
MSG |
static boolean |
SKIP_COMMITTED |
static String |
X_POWERED_BY |
构造器和说明 |
---|
Mvcs() |
限定符和类型 | 方法和说明 |
---|---|
static void |
close() |
static NutMvcContext |
ctx() |
static void |
deposeSession(javax.servlet.http.HttpSession session)
注销当前 HTTP 会话。
|
static ActionContext |
getActionContext()
获取 Action 执行的上下文
|
static AtMap |
getAtMap() |
static String |
getDefaultLocalizationKey()
返回默认的本地化字符串 KEY
|
static javax.servlet.http.HttpSession |
getHttpSession() |
static javax.servlet.http.HttpSession |
getHttpSession(boolean createNew) |
static Ioc |
getIoc()
获取全局的Ioc对象
|
static IocContext |
getIocContext()
获取对象装配的上下文环境
|
static Map<String,Object> |
getLocaleMessage(String key) |
static String |
getLocalizationKey()
获取当前会话的本地字符串集合的键值;如果当前 HTTP 会话不存在,则返回 null
|
static Set<String> |
getLocalizationKeySet()
返回当前加载了的本地化字符串的键值
|
static String |
getMessage(javax.servlet.ServletRequest req,
String key)
获取当前请求对象的字符串表中的某一个字符串
|
static NutMessageMap |
getMessageMap(javax.servlet.ServletRequest req)
获取当前请求对象的字符串表(NutMessageMap 封装)
|
static Map<String,String> |
getMessages(javax.servlet.ServletRequest req)
获取当前请求对象的字符串表
|
static Map<String,Map<String,Object>> |
getMessageSet() |
static String |
getName() |
static NutConfig |
getNutConfig() |
static javax.servlet.http.HttpServletRequest |
getReq()
获取 HTTP 请求对象
|
static String |
getRequestPath(javax.servlet.http.HttpServletRequest req)
获取当前请求的路径,并去掉后缀
|
static RequestPath |
getRequestPathObject(javax.servlet.http.HttpServletRequest req)
获取当前请求的路径,并去掉后缀
|
static RequestPath |
getRequestPathObject(String url)
获取当前请求的路径,并去掉后缀
|
static javax.servlet.http.HttpServletResponse |
getResp()
获取 HTTP 响应对象
|
static javax.servlet.ServletContext |
getServletContext()
获取 Servlet 执行的上下文
|
static Object |
getSessionAttrSafe(String key) |
static Context |
reqt() |
static Context |
resetALL()
重置当前线程所持有的对象
|
static void |
set(String name,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
static void |
setActionContext(ActionContext actionContext)
设置 Action 执行的上下文
|
static void |
setAtMap(AtMap atmap) |
static void |
setDefaultLocalizationKey(String key)
设置默认的多国语言
|
static void |
setIoc(Ioc ioc) |
static void |
setIocContext(IocContext iocContext)
设置对象装配的上下文环境
|
static boolean |
setLocalizationKey(String key)
设置本地化字符串的键值
如果你用的是 Nutz.Mvc 默认的本地化机制,那么你的本地字符串键值,相当于一个你目录名。
|
static void |
setMessageSet(Map<String,Map<String,Object>> messageSet) |
static void |
setNutConfig(NutConfig config) |
static void |
setServletContext(javax.servlet.ServletContext servletContext)
设置 Servlet 执行的上下文
|
static void |
setSessionAttrSafe(String key,
Object val,
boolean sessionCreate) |
static NutMap |
toParamMap(Reader r,
String enc) |
static void |
updateRequestAttributes(javax.servlet.http.HttpServletRequest req)
为当前的 HTTP 请求对象设置一些必要的属性。
|
static void |
write(javax.servlet.http.HttpServletResponse resp,
Object obj,
JsonFormat format)
它将对象序列化成 JSON 字符串,并写入 HTTP 响应
|
static void |
write(javax.servlet.http.HttpServletResponse resp,
Writer writer,
Object obj,
JsonFormat format) |
public static boolean disableFastClassInvoker
public static boolean DISPLAY_METHOD_LINENUMBER
public static boolean SKIP_COMMITTED
public static boolean DISABLE_X_POWERED_BY
public static String X_POWERED_BY
@Deprecated public static NutMvcContext ctx
public static Map<String,String> getMessages(javax.servlet.ServletRequest req)
req
- 请求对象public static NutMessageMap getMessageMap(javax.servlet.ServletRequest req)
req
- 请求对象public static String getMessage(javax.servlet.ServletRequest req, String key)
req
- 请求对象key
- 字符串键值public static String getLocalizationKey()
public static boolean setLocalizationKey(String key)
如果你用的是 Nutz.Mvc 默认的本地化机制,那么你的本地字符串键值,相当于一个你目录名。
比如 "zh_CN" 等
key
- 键值public static Set<String> getLocalizationKeySet()
public static void setDefaultLocalizationKey(String key)
key
- 默认的多国语言 KEYpublic static String getDefaultLocalizationKey()
public static void updateRequestAttributes(javax.servlet.http.HttpServletRequest req)
req
- HTTP 请求对象public static String getRequestPath(javax.servlet.http.HttpServletRequest req)
req
- HTTP 请求对象public static RequestPath getRequestPathObject(javax.servlet.http.HttpServletRequest req)
req
- HTTP 请求对象public static RequestPath getRequestPathObject(String url)
url
- 请求路径的URLpublic static void deposeSession(javax.servlet.http.HttpSession session)
session
- HTTP 会话对象public static void write(javax.servlet.http.HttpServletResponse resp, Object obj, JsonFormat format) throws IOException
resp
- 响应对象obj
- 数据对象format
- JSON 的格式化方式IOException
- 写入失败public static void write(javax.servlet.http.HttpServletResponse resp, Writer writer, Object obj, JsonFormat format) throws IOException
IOException
public static NutMvcContext ctx()
public static final javax.servlet.http.HttpServletRequest getReq()
public static final javax.servlet.http.HttpServletResponse getResp()
public static final String getName()
public static final ActionContext getActionContext()
public static void set(String name, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
public static void setServletContext(javax.servlet.ServletContext servletContext)
servletContext
- Servlet 执行的上下文public static void setActionContext(ActionContext actionContext)
actionContext
- Action 执行的上下文public static javax.servlet.ServletContext getServletContext()
public static void setIocContext(IocContext iocContext)
iocContext
- 对象装配的上下文环境public static IocContext getIocContext()
public static Ioc getIoc()
public static void setIoc(Ioc ioc)
public static AtMap getAtMap()
public static void setAtMap(AtMap atmap)
public static void setNutConfig(NutConfig config)
public static NutConfig getNutConfig()
public static Context resetALL()
public static javax.servlet.http.HttpSession getHttpSession()
public static javax.servlet.http.HttpSession getHttpSession(boolean createNew)
public static void close()
public static Context reqt()
public static void setSessionAttrSafe(String key, Object val, boolean sessionCreate)
public static NutMap toParamMap(Reader r, String enc) throws IOException
IOException
Copyright © 2017. All rights reserved.