com.opensymphony.webwork.interceptor
Class FlashInterceptor
java.lang.Object
com.opensymphony.xwork.interceptor.AroundInterceptor
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.
- key - The Http Session key under which the action will be stored,
default to
DEFAULT_KEY
which is
the string '__flashAction'.
- operation - The operation mode of this interceptor, either
STORE
having a string value of 'Store' or
RETRIEVE
having a string value of 'Retrieve'
The default operation mode is RETRIEVE
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
FlashInterceptor
public FlashInterceptor()
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)