Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
<action name="LazyFoo" class="com.opensymphony.xwork2.SimpleAction">
  <result name="success">result.jsp</result>
  <interceptor-ref name="lazy">
    <param name="foo">${bar}</param>
  </interceptor-ref>
</action>
Code Block
java
java
public class MockLazyInterceptor extends AbstractInterceptor implements WithLazyParams {


    private String foo = "";

    public void setFoo(String foo) {
        this.foo = foo;
    }

    public String intercept(ActionInvocation invocation) throws Exception {
        ....
        return invocation.invoke();
    }
}

Please be aware that order of interceptors can matter when want to access parameters passed via request as those parameters are set by Parameters Interceptor.

...