|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork2.interceptor.AbstractInterceptor
com.opensymphony.xwork2.interceptor.ChainingInterceptor
public class ChainingInterceptor
An interceptor that copies all the properties of every object in the value stack to the currently executing object, except for any object that implements
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 FormField Summary | |
---|---|
protected java.util.Collection<java.lang.String> |
excludes
|
protected java.util.Collection<java.lang.String> |
includes
|
protected ReflectionProvider |
reflectionProvider
|
Constructor Summary | |
---|---|
ChainingInterceptor()
|
Method Summary | |
---|---|
java.util.Collection<java.lang.String> |
getExcludes()
Gets list of parameter names to exclude |
java.util.Collection<java.lang.String> |
getIncludes()
Gets list of parameter names to include |
java.lang.String |
intercept(ActionInvocation invocation)
Override to handle interception |
void |
setCopyErrors(java.lang.String copyErrors)
|
void |
setCopyFieldErrors(java.lang.String copyFieldErrors)
|
void |
setCopyMessages(java.lang.String copyMessages)
|
void |
setExcludes(java.util.Collection<java.lang.String> excludes)
Sets the list of parameter names to exclude from copying (all others will be included). |
void |
setIncludes(java.util.Collection<java.lang.String> includes)
Sets the list of parameter names to include when copying (all others will be excluded). |
void |
setReflectionProvider(ReflectionProvider prov)
|
Methods inherited from class com.opensymphony.xwork2.interceptor.AbstractInterceptor |
---|
destroy, init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Collection<java.lang.String> excludes
protected java.util.Collection<java.lang.String> includes
protected ReflectionProvider reflectionProvider
Constructor Detail |
---|
public ChainingInterceptor()
Method Detail |
---|
public void setReflectionProvider(ReflectionProvider prov)
public void setCopyErrors(java.lang.String copyErrors)
public void setCopyFieldErrors(java.lang.String copyFieldErrors)
public void setCopyMessages(java.lang.String copyMessages)
public java.lang.String intercept(ActionInvocation invocation) throws java.lang.Exception
AbstractInterceptor
intercept
in interface Interceptor
intercept
in class AbstractInterceptor
invocation
- the action invocation
ActionInvocation.invoke()
, or from the interceptor itself.
java.lang.Exception
- any system-level error, as defined in Action.execute()
.public java.util.Collection<java.lang.String> getExcludes()
public void setExcludes(java.util.Collection<java.lang.String> excludes)
excludes
- the excludes listpublic java.util.Collection<java.lang.String> getIncludes()
public void setIncludes(java.util.Collection<java.lang.String> includes)
includes
- the includes list
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |