com.opensymphony.xwork.interceptor
Class ChainingInterceptor

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

public class ChainingInterceptor
extends AroundInterceptor

An interceptor that copies all the properties of every object in the value stack to the currently executing object, except for any object that implements Unchainable. A collection of optional includes and excludes may be provided to control how and which parameters are copied. Only includes or excludes may be specified. Specifying both results in undefined behavior. See the javadocs for OgnlUtil.copy(Object, Object, java.util.Map, java.util.Collection, java.util.Collection) for more information.

It is important to remember that this interceptor does nothing if there are no objects already on the stack. This means two things: One, you can safely apply it to all your actions without any worry of adverse affects. Two, it is up to you to ensure an object exists in the stack prior to invoking this action. The most typical way this is done is through the use of the chain result type, which combines with this interceptor to make up the action chaining feature.

Interceptor parameters:

Extending the interceptor:

There are no known extension points to this interceptor.

Example code:

 
 
 <action name="someAction" class="com.examples.SomeAction">
     <interceptor-ref name="basicStack"/>
     <result name="success" type="chain">otherAction</result>
 </action>

 <action name="otherAction" class="com.examples.OtherAction">
     <interceptor-ref name="chain"/>
     <interceptor-ref name="basicStack"/>
     <result name="success">good_result.ftl</result>
 </action>
 
 
 

Version:
$Date: 2007-11-30 08:32:25 -0600 (Fri, 30 Nov 2007) $ $Id: ChainingInterceptor.java 1695 2007-11-30 14:32:25Z tm_jee $
Author:
Rainer, tmjee
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.opensymphony.xwork.interceptor.AroundInterceptor
log
 
Constructor Summary
ChainingInterceptor()
           
 
Method Summary
protected  void after(ActionInvocation invocation, String result)
          No operation, does nothing
protected  void before(ActionInvocation invocation)
          Copy value of method invocation excluded and included by includes excludes separately into ValueStack's CompoundRoot.
 Collection getExcludes()
           
 Collection getIncludes()
           
 void setExcludes(String excludes)
           
 void setIncludes(String includes)
           
 
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
 

Constructor Detail

ChainingInterceptor

public ChainingInterceptor()
Method Detail

after

protected void after(ActionInvocation invocation,
                     String result)
              throws Exception
No operation, does nothing

Specified by:
after in class AroundInterceptor
Parameters:
invocation -
result -
Throws:
Exception

before

protected void before(ActionInvocation invocation)
               throws Exception
Copy value of method invocation excluded and included by includes excludes separately into ValueStack's CompoundRoot.

Specified by:
before in class AroundInterceptor
Parameters:
invocation -
Throws:
Exception

getExcludes

public Collection getExcludes()

setExcludes

public void setExcludes(String excludes)

getIncludes

public Collection getIncludes()

setIncludes

public void setIncludes(String includes)

WebWork Project Page