com.opensymphony.webwork.interceptor
Class FlashInterceptor

java.lang.Object
  extended by com.opensymphony.xwork.interceptor.AroundInterceptor
      extended by com.opensymphony.webwork.interceptor.FlashInterceptor
All Implemented Interfaces:
Interceptor, Serializable

public class FlashInterceptor
extends AroundInterceptor

Flash interceptor (FlashInterceptor) possibly with FlashResult allows current action to be available even after a redirect. It does this by saving the current action into http session and pushing it back into the stack next request, resulting in the nett effect of the action and its related information being available across redirect.

There's no intended extension points
 
 <!-- Usage 1: (Using only Flash interceptor)  -->
 <action name="store" ...>
        <interceptor-ref name="flash">
                <param name="operation">Store</param>
     </interceptor-ref>
     <interceptor-ref name="defaultStack" />
     <result type="redirect">redirectToSomeWhere.jsp</result>
 </action>
 <action name="retrieve">
        <interceptor-ref name="flash">
        <param name="operation">Retrieve</param>
     </interceptor-ref>
     <interceptor-ref name="defaultStack" />
     <result>pageWhereWeNeedFlashActionStored.jsp</result>
 </action>
 
 
 <!-- Usage 2: (Using Flash Interceptor and Flash Result) -->
 <action name="store">
        <result type="flash">redirectToSomeWhere.jsp</result>
 </action>
 <action name="retrieve">
        <interceptor-ref name="flash">
        <param name="operation">Retrieve</param>
     </interceptor-ref>
     <interceptor-ref name="defaultStack" />
     <result>pageWhereWeNeedFlashActionStored.jsp</result>
 </action>
 
 
 

Version:
$Date: 2007-02-04 13:33:20 +0800 (Sun, 04 Feb 2007) $ $Id: FlashInterceptor.java 2830 2007-02-04 05:33:20Z tm_jee $
Author:
tmjee
See Also:
Serialized Form

Field Summary
static String DEFAULT_KEY
           
static String RETRIEVE
           
static String STORE
           
 
Fields inherited from class com.opensymphony.xwork.interceptor.AroundInterceptor
log
 
Constructor Summary
FlashInterceptor()
           
 
Method Summary
protected  void after(ActionInvocation invocation, String result)
          Called after the invocation has been executed.
protected  void before(ActionInvocation invocation)
          Called before the invocation has been executed.
 String getKey()
           
 String getOperation()
           
 void setKey(String key)
           
 void setOperation(String operation)
           
 
Methods inherited from class com.opensymphony.xwork.interceptor.AroundInterceptor
destroy, init, intercept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_KEY

public static final String DEFAULT_KEY
See Also:
Constant Field Values

STORE

public static final String STORE
See Also:
Constant Field Values

RETRIEVE

public static final String RETRIEVE
See Also:
Constant Field Values
Constructor Detail

FlashInterceptor

public FlashInterceptor()
Method Detail

setKey

public void setKey(String key)

getKey

public String getKey()

setOperation

public void setOperation(String operation)

getOperation

public String getOperation()

after

protected void after(ActionInvocation invocation,
                     String result)
              throws Exception
Description copied from class: AroundInterceptor
Called after the invocation has been executed.

Specified by:
after in class AroundInterceptor
result - the result value returned by the invocation
Throws:
Exception
See Also:
AroundInterceptor.after(com.opensymphony.xwork.ActionInvocation, java.lang.String)

before

protected void before(ActionInvocation invocation)
               throws Exception
Description copied from class: AroundInterceptor
Called before the invocation has been executed.

Specified by:
before in class AroundInterceptor
Throws:
Exception
See Also:
AroundInterceptor.before(com.opensymphony.xwork.ActionInvocation)

WebWork Project Page