`
yaozuodaoforfly
  • 浏览: 119423 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

ChainingInterceptor

 
阅读更多

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
分享到:
评论

相关推荐

    struts2_工作流程

    - **ChainingInterceptor**:配合chain结果类型,实现Action间的转发。 - **StrutsConversionErrorInterceptor**:处理类型转换错误。 - **CookieInterceptor**:处理Cookie操作。 - **ClearSessionInterceptor**:...

    Struts2默认拦截器解析[归类].pdf

    3. **ChainingInterceptor** - 链式拦截器:支持Action链,一个Action执行完毕后,可以调用另一个Action。 4. **StrutsConversionErrorInterceptor** - 转换错误拦截器:处理类型转换失败的情况,将错误信息放入...

    Struts2拦截器及其用法详细说明

    - **ChainingInterceptor**:使Action能访问上一个Action的属性,常与`chain`结果类型配合使用。 - **CheckboxInterceptor**:处理未选中的多选框,添加默认的`false`值。 - **ConversionErrorInterceptor**:...

    struts拦截器介绍

    2. **ChainingInterceptor**:链式拦截器,使得前一个Action的属性能够被后续的Action访问,通常与`&lt;result type="chain"&gt;` 结合使用,实现Action间的流转。 3. **CheckboxInterceptor**:复选框拦截器,处理未被...

    Xwork——Struts2核心

    - **ChainingInterceptor**:用于支持动作链的执行。 - **ModelDrivenInterceptor**:用于支持基于模型的Action。 - **ValidationInterceptor**:用于集成Xwork的验证框架。 #### 高级XWork配置 除了基础的配置...

Global site tag (gtag.js) - Google Analytics