WebWork 2 : Interceptor Order

阅读更多
This page last changed on Nov 30, 2004 by jcarreira.

Interceptors provide an excellent means to wrap before/after processing. The concept reduces code duplication (think AOP).

Order of interceptors…
"xaStack"> 
  "thisWillRunFirstInterceptor"/>
  "thisWillRunNextInterceptor"/>
  "followedByThisInterceptor"/>
  "thisWillRunLastInterceptor"/>

Note that some interceptors will interrupt the stack/chain/flow… so the order is very important.

Iterceptors implementing com.opensymphony.xwork.interceptor.PreResultListener will run after the Action executes its action method but before the Result executes
thisWillRunFirstInterceptor
  thisWillRunNextInterceptor
    followedByThisInterceptor
      thisWillRunLastInterceptor
        MyAction1
        MyAction2 (chain)
        MyPreResultListener  
        MyResult (result)
      thisWillRunLastInterceptor
    followedByThisInterceptor
  thisWillRunNextInterceptor
thisWillRunFirstInterceptor

你可能感兴趣的:(Webwork,AOP)