org.apache.struts2.interceptor
Class CreateSessionInterceptor

java.lang.Object
  extended by com.opensymphony.xwork2.interceptor.AbstractInterceptor
      extended by org.apache.struts2.interceptor.CreateSessionInterceptor
All Implemented Interfaces:
Interceptor, Serializable

public class CreateSessionInterceptor
extends AbstractInterceptor

This interceptor creates the HttpSession.

This is particular usefull 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="create-session"/>
     <interceptor-ref name="defaultStack"/>
     <result name="input">input_with_token_tag.ftl</result>
 </action>

 
 

Version:
$Date: 2006-11-06 16:01:43 +0100 (Mo, 06. Nov 2006) $ $Id: CreateSessionInterceptor.java 471756 2006-11-06 15:01:43Z husted $
See Also:
Serialized Form

Field Summary
private static Log _log
           
private static long serialVersionUID
           
 
Constructor Summary
CreateSessionInterceptor()
           
 
Method Summary
 String intercept(ActionInvocation invocation)
          Override to handle interception
 
Methods inherited from class com.opensymphony.xwork2.interceptor.AbstractInterceptor
destroy, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

_log

private static final Log _log
Constructor Detail

CreateSessionInterceptor

public CreateSessionInterceptor()
Method Detail

intercept

public String intercept(ActionInvocation invocation)
                 throws Exception
Description copied from class: AbstractInterceptor
Override to handle interception

Specified by:
intercept in interface Interceptor
Specified by:
intercept in class AbstractInterceptor
Returns:
the return code, either returned from ActionInvocation.invoke(), or from the interceptor itself.
Throws:
Exception - any system-level error, as defined in Action.execute().


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.