org.nutz.mvc
类 ActionContext

java.lang.Object
  继承者 org.nutz.lang.util.AbstractContext
      继承者 org.nutz.lang.util.SimpleContext
          继承者 org.nutz.mvc.ActionContext
所有已实现的接口:
java.lang.Cloneable, Context

public class ActionContext
extends SimpleContext

Action执行的上下文

作者:
wendal(wendal1985@gmail.com), zozoh(zozohtnt@gmail.com)

构造方法摘要
ActionContext()
           
 
方法摘要
 java.lang.Throwable getError()
          获取异常对象
 Ioc getIoc()
          获取全局的Ioc对象
 java.lang.reflect.Method getMethod()
          获取这个Action对应的Method
 java.lang.Object[] getMethodArgs()
          获取将要执行Method的参数
 java.lang.Object getMethodReturn()
          获取method返回值
 java.lang.Object getModule()
          获取将要执行Method的对象
 java.lang.String getPath()
          获取当前请求的path,经过去后缀处理
 java.util.List<java.lang.String> getPathArgs()
          获取路径参数
 javax.servlet.http.HttpServletRequest getRequest()
          获取请求的HttpServletRequest
 javax.servlet.http.HttpServletResponse getResponse()
          获取请求的HttpServletResponse
 javax.servlet.ServletContext getServletContext()
          获取ServletContext
 ActionContext setError(java.lang.Throwable error)
          设置异常对象,一般由ActionChain捕捉到异常后调用
 ActionContext setMethod(java.lang.reflect.Method m)
          设置这个Action对应的Method
 ActionContext setMethodArgs(java.lang.Object[] args)
           
 ActionContext setMethodReturn(java.lang.Object re)
           
 ActionContext setModule(java.lang.Object obj)
           
 ActionContext setPath(java.lang.String ph)
          设置当前请求的path,经过去后缀处理
 ActionContext setPathArgs(java.util.List<java.lang.String> args)
           
 ActionContext setRequest(javax.servlet.http.HttpServletRequest req)
           
 ActionContext setResponse(javax.servlet.http.HttpServletResponse resp)
           
 ActionContext setServletContext(javax.servlet.ServletContext sc)
           
 
从类 org.nutz.lang.util.SimpleContext 继承的方法
clear, clone, get, getInnerMap, has, keys, set, toString
 
从类 org.nutz.lang.util.AbstractContext 继承的方法
getAs, getBoolean, getFloat, getInt, getList, getMap, getString, putAll, putAll
 
从类 java.lang.Object 继承的方法
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

ActionContext

public ActionContext()
方法详细信息

getIoc

public Ioc getIoc()
获取全局的Ioc对象

返回:
如果定义了IocBy注解,则肯定返回非空对象

getError

public java.lang.Throwable getError()
获取异常对象


setError

public ActionContext setError(java.lang.Throwable error)
设置异常对象,一般由ActionChain捕捉到异常后调用

参数:
error - 异常对象
返回:
当前上下文,即被调用者本身

getPath

public java.lang.String getPath()
获取当前请求的path,经过去后缀处理

返回:
当前请求的path,经过去后缀处理

setPath

public ActionContext setPath(java.lang.String ph)
设置当前请求的path,经过去后缀处理

参数:
ph - 请求的path,,经过去后缀处理
返回:
当前上下文,即被调用者本身

getPathArgs

public java.util.List<java.lang.String> getPathArgs()
获取路径参数

返回:
路径参数

setPathArgs

public ActionContext setPathArgs(java.util.List<java.lang.String> args)

getMethod

public java.lang.reflect.Method getMethod()
获取这个Action对应的Method


setMethod

public ActionContext setMethod(java.lang.reflect.Method m)
设置这个Action对应的Method

参数:
m - 这个Action对应的Method
返回:
当前上下文,即被调用者本身

getModule

public java.lang.Object getModule()
获取将要执行Method的对象

返回:
执行对象,即模块类的实例

setModule

public ActionContext setModule(java.lang.Object obj)

getMethodArgs

public java.lang.Object[] getMethodArgs()
获取将要执行Method的参数

返回:
method的参数

setMethodArgs

public ActionContext setMethodArgs(java.lang.Object[] args)

getMethodReturn

public java.lang.Object getMethodReturn()
获取method返回值


setMethodReturn

public ActionContext setMethodReturn(java.lang.Object re)

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
获取请求的HttpServletRequest

返回:
请求的HttpServletRequest

setRequest

public ActionContext setRequest(javax.servlet.http.HttpServletRequest req)

getResponse

public javax.servlet.http.HttpServletResponse getResponse()
获取请求的HttpServletResponse

返回:
请求的HttpServletResponse

setResponse

public ActionContext setResponse(javax.servlet.http.HttpServletResponse resp)

getServletContext

public javax.servlet.ServletContext getServletContext()
获取ServletContext

返回:
ServletContext

setServletContext

public ActionContext setServletContext(javax.servlet.ServletContext sc)