struts2值栈ValueStack中都有哪些东西?

com.opensymphony.xwork2.dispatcher.HttpServletRequest

application

com.opensymphony.xwork2.dispatcher.HttpServletResponse

com.opensymphony.xwork2.ActionContext.name

com.opensymphony.xwork2.ActionContext.application

attr

com.opensymphony.xwork2.ActionContext.container

com.opensymphony.xwork2.ActionContext.session

com.opensymphony.xwork2.ActionContext.actionInvocation

session

request

action

struts.actionMapping

parameters

com.opensymphony.xwork2.ActionContext.parameters

上面列出来的就是键名(key)了,具体是什么查百度了,可以通过ValueStack.getContext().get(key)得到相关的对象。

拦截器中

com.opensymphony.xwork2.interceptor.Interceptor的intercept中通过arg0.getInvocationContext().getValueStack()可以得到值栈。

 action中,还记得(RequestAware,SessionAware,ApplicationAware)不

实现RequestAware接口,在得到的map中arg0.get("struts.valueStack");可得

 

 

posted on 2014-05-11 18:54  angelshelter  阅读(294)  评论(0编辑  收藏  举报

导航