com.opensymphony.xwork.interceptor
Class DefaultWorkflowInterceptor

java.lang.Object
  extended bycom.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor
All Implemented Interfaces:
Interceptor

public class DefaultWorkflowInterceptor
extends Object
implements Interceptor

An interceptor that does some basic validation workflow before allowing the interceptor chain to continue. The order of execution in the workflow is:

  1. If the action being executed implements Validateable, the action's validate method is called.
  2. Next, if the action implements ValidationAware, the action's hasErrors method is called. If this method returns true, this interceptor stops the chain from continuing and immediately returns Action.INPUT
Note: if the action doesn't implement either interface, this interceptor effectively does nothing.

Author:
Jason Carreira

Constructor Summary
DefaultWorkflowInterceptor()
           
 
Method Summary
 void destroy()
          Called to let an interceptor clean up any resources it has allocated.
 void init()
          Called after an interceptor is created, but before any requests are processed using intercept , giving the Interceptor a chance to initialize any needed resources.
 String intercept(ActionInvocation invocation)
          Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the request by the ActionInvocation or to short-circuit the processing and just return a String return code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWorkflowInterceptor

public DefaultWorkflowInterceptor()
Method Detail

destroy

public void destroy()
Description copied from interface: Interceptor
Called to let an interceptor clean up any resources it has allocated.

Specified by:
destroy in interface Interceptor

init

public void init()
Description copied from interface: Interceptor
Called after an interceptor is created, but before any requests are processed using intercept , giving the Interceptor a chance to initialize any needed resources.

Specified by:
init in interface Interceptor

intercept

public String intercept(ActionInvocation invocation)
                 throws Exception
Description copied from interface: Interceptor
Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the request by the ActionInvocation or to short-circuit the processing and just return a String return code.

Specified by:
intercept in interface Interceptor
Returns:
the return code, either returned from ActionInvocation.invoke(), or from the interceptor itself.
Throws:
Exception - any system-level error, as defined in Action.execute().

XWork Project Page