public class DefaultWorkflowInterceptor extends MethodFilterInterceptor
MethodFilterInterceptor
for more info.
This interceptor also supports the following interfaces which can implemented by actions:
<action name="someAction" class="com.examples.SomeAction"> <interceptor-ref name="params"/> <interceptor-ref name="validation"/> <interceptor-ref name="workflow"/> <result name="success">good_result.ftl</result> </action> <-- In this case myMethod as well as mySecondMethod of the action class will not pass through the workflow process --> <action name="someAction" class="com.examples.SomeAction"> <interceptor-ref name="params"/> <interceptor-ref name="validation"/> <interceptor-ref name="workflow"> <param name="excludeMethods">myMethod,mySecondMethod</param> </interceptor-ref name="workflow"> <result name="success">good_result.ftl</result> </action> <-- In this case, the result named "error" will be used when an action / field error is found --> <-- The Interceptor will only be applied for myWorkflowMethod method of action classes, since this is the only included method while any others are excluded --> <action name="someAction" class="com.examples.SomeAction"> <interceptor-ref name="params"/> <interceptor-ref name="validation"/> <interceptor-ref name="workflow"> <param name="inputResultName">error</param> <param name="excludeMethods">*</param> <param name="includeMethods">myWorkflowMethod</param> </interceptor-ref> <result name="success">good_result.ftl</result> </action>
excludeMethods, includeMethods, log
Constructor and Description |
---|
DefaultWorkflowInterceptor() |
Modifier and Type | Method and Description |
---|---|
protected String |
doIntercept(ActionInvocation invocation)
Intercept
ActionInvocation and returns a inputResultName
when action / field errors is found registered. |
protected String |
processInputConfig(Object action,
String method,
String currentResultName)
Process
InputConfig annotation applied to method |
protected String |
processValidationErrorAware(Object action,
String currentResultName)
Notify action if it implements
ValidationErrorAware interface |
void |
setInputResultName(String inputResultName)
Set the
inputResultName (result name to be returned when
a action / field error is found registered). |
applyInterceptor, getExcludeMethodsSet, getIncludeMethodsSet, intercept, setExcludeMethods, setIncludeMethods
destroy, init
public void setInputResultName(String inputResultName)
inputResultName
(result name to be returned when
a action / field error is found registered). Default to Action.INPUT
inputResultName
- what result name to use when there was validation error(s).protected String doIntercept(ActionInvocation invocation) throws Exception
ActionInvocation
and returns a inputResultName
when action / field errors is found registered.doIntercept
in class MethodFilterInterceptor
invocation
- the action invocationException
protected String processInputConfig(Object action, String method, String currentResultName) throws Exception
InputConfig
annotation applied to methodException
protected String processValidationErrorAware(Object action, String currentResultName)
ValidationErrorAware
interfaceCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.