An interceptor that copies all the properties of every object in the value stack to the currently executing object, except for any object that implementsUnchainable
. 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:
- excludes (optional) - the list of parameter names to exclude from copying (all others will be included).
- includes (optional) - the list of parameter names to include when copying (all others will be excluded).
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>
该迭代器的作用是把value stack里面对象的属性拷贝到自己的action
相关推荐
- **ChainingInterceptor**:配合chain结果类型,实现Action间的转发。 - **StrutsConversionErrorInterceptor**:处理类型转换错误。 - **CookieInterceptor**:处理Cookie操作。 - **ClearSessionInterceptor**:...
3. **ChainingInterceptor** - 链式拦截器:支持Action链,一个Action执行完毕后,可以调用另一个Action。 4. **StrutsConversionErrorInterceptor** - 转换错误拦截器:处理类型转换失败的情况,将错误信息放入...
- **ChainingInterceptor**:使Action能访问上一个Action的属性,常与`chain`结果类型配合使用。 - **CheckboxInterceptor**:处理未选中的多选框,添加默认的`false`值。 - **ConversionErrorInterceptor**:...
2. **ChainingInterceptor**:链式拦截器,使得前一个Action的属性能够被后续的Action访问,通常与`<result type="chain">` 结合使用,实现Action间的流转。 3. **CheckboxInterceptor**:复选框拦截器,处理未被...
- **ChainingInterceptor**:用于支持动作链的执行。 - **ModelDrivenInterceptor**:用于支持基于模型的Action。 - **ValidationInterceptor**:用于集成Xwork的验证框架。 #### 高级XWork配置 除了基础的配置...