public class ChainingInterceptor extends AbstractInterceptor
Unchainable
. 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 ReflectionProvider.copy(Object, Object,
java.util.Map, java.util.Collection, java.util.Collection)
for more information.
Note: It is important to remember that this interceptor does nothing if there are no objects already on the stack.
Example:
<constant name="struts.xwork.chaining.copyErrors" value="true"/>Note: By default actionErrors and actionMessages are excluded when copping object's properties. Interceptor parameters:
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>
ActionChainResult
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Collection<String> |
excludes |
protected Collection<String> |
includes |
protected ReflectionProvider |
reflectionProvider |
Constructor and Description |
---|
ChainingInterceptor() |
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getExcludes()
Gets list of parameter names to exclude
|
Collection<String> |
getIncludes()
Gets list of parameter names to include
|
String |
intercept(ActionInvocation invocation)
Override to handle interception
|
void |
setCopyErrors(String copyErrors) |
void |
setCopyFieldErrors(String copyFieldErrors) |
void |
setCopyMessages(String copyMessages) |
void |
setExcludes(Collection<String> excludes)
Sets the list of parameter names to exclude from copying (all others will be included).
|
void |
setIncludes(Collection<String> includes)
Sets the list of parameter names to include when copying (all others will be excluded).
|
void |
setReflectionProvider(ReflectionProvider prov) |
destroy, init
protected Collection<String> excludes
protected Collection<String> includes
protected ReflectionProvider reflectionProvider
public void setReflectionProvider(ReflectionProvider prov)
public void setCopyErrors(String copyErrors)
public void setCopyFieldErrors(String copyFieldErrors)
public void setCopyMessages(String copyMessages)
public String intercept(ActionInvocation invocation) throws Exception
AbstractInterceptor
intercept
in interface Interceptor
intercept
in class AbstractInterceptor
invocation
- the action invocationActionInvocation.invoke()
, or from the interceptor itself.Exception
- any system-level error, as defined in Action.execute()
.public Collection<String> getExcludes()
public void setExcludes(Collection<String> excludes)
excludes
- the excludes listpublic Collection<String> getIncludes()
public void setIncludes(Collection<String> includes)
includes
- the includes listCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.