org.apache.struts2.interceptor
类 CreateSessionInterceptor
java.lang.Object
com.opensymphony.xwork2.interceptor.AbstractInterceptor
org.apache.struts2.interceptor.CreateSessionInterceptor
- 所有已实现的接口:
- com.opensymphony.xwork2.interceptor.Interceptor, Serializable
public class CreateSessionInterceptor
- extends com.opensymphony.xwork2.interceptor.AbstractInterceptor
This interceptor creates the HttpSession if it doesn't exist, also SessionMap is recreated and put in ServletActionContext.
This is particular useful when using the <@s.token> tag in freemarker templates.
The tag do require that a HttpSession is already created since freemarker commits
the response to the client immediately.
Interceptor parameters:
Example:
<action name="someAction" class="com.examples.SomeAction">
<interceptor-ref name="createSession"/>
<interceptor-ref name="defaultStack"/>
<result name="input">input_with_token_tag.ftl</result>
</action>
- 版本:
- $Date$ $Id$
- 另请参见:
- 序列化表格
从类 com.opensymphony.xwork2.interceptor.AbstractInterceptor 继承的方法 |
destroy, init |
CreateSessionInterceptor
public CreateSessionInterceptor()
intercept
public String intercept(com.opensymphony.xwork2.ActionInvocation invocation)
throws Exception
- 指定者:
- 接口
com.opensymphony.xwork2.interceptor.Interceptor
中的 intercept
- 指定者:
- 类
com.opensymphony.xwork2.interceptor.AbstractInterceptor
中的 intercept
- 抛出:
Exception