svn commit: r997234 - /struts/struts2/trunk/core/src/main/resources/struts-default.xml
Author: lukaszlenart Date: Wed Sep 15 09:04:00 2010 New Revision: 997234 URL: http://svn.apache.org/viewvc?rev=997234&view=rev Log: Resolved WW-3491 - removed interceptors that doesn't exist any more Modified: struts/struts2/trunk/core/src/main/resources/struts-default.xml Modified: struts/struts2/trunk/core/src/main/resources/struts-default.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/struts-default.xml?rev=997234&r1=997233&r2=997234&view=diff == --- struts/struts2/trunk/core/src/main/resources/struts-default.xml (original) +++ struts/struts2/trunk/core/src/main/resources/struts-default.xml Wed Sep 15 09:04:00 2010 @@ -129,7 +129,6 @@ - @@ -143,7 +142,6 @@ -
svn commit: r997345 - in /struts/struts2/trunk/xwork-core/src: main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java test/java/com/opensymphony/xwork2/interceptor/ChainingInterceptorT
Author: lukaszlenart Date: Wed Sep 15 14:12:26 2010 New Revision: 997345 URL: http://svn.apache.org/viewvc?rev=997345&view=rev Log: Solved WW-3488 - exclude copy Action's Errors and Messages from chain Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/interceptor/ChainingInterceptorTest.java Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java?rev=997345&r1=997344&r2=997345&view=diff == --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java Wed Sep 15 14:12:26 2010 @@ -26,12 +26,7 @@ import com.opensymphony.xwork2.util.logg import com.opensymphony.xwork2.util.logging.LoggerFactory; import com.opensymphony.xwork2.util.reflection.ReflectionProvider; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; /** @@ -104,6 +99,12 @@ public class ChainingInterceptor extends private static final Logger LOG = LoggerFactory.getLogger(ChainingInterceptor.class); +private static final String ACTION_ERRORS = "actionErrors"; +private static final String ACTION_MESSAGES = "actionMessages"; + +private boolean copyMessages = false; +private boolean copyErrors = false; + protected Collection excludes; protected Collection includes; @@ -114,37 +115,67 @@ public class ChainingInterceptor extends this.reflectionProvider = prov; } +@Inject(value = "struts.xwork.chaining.copyErrors", required = false) +public void setCopyErrors(String copyErrors) { +this.copyErrors = "true".equalsIgnoreCase(copyErrors); +} + +@Inject(value = "struts.xwork.chaining.copyMessages", required = false) +public void setCopyMessages(String copyMessages) { +this.copyMessages = "true".equalsIgnoreCase(copyMessages); +} + @Override public String intercept(ActionInvocation invocation) throws Exception { ValueStack stack = invocation.getStack(); CompoundRoot root = stack.getRoot(); +if (shouldCopyStack(invocation, root)) { +copyStack(invocation, root); +} +return invocation.invoke(); +} -if (root.size() > 1 && isChainResult(invocation)) { -List list = new ArrayList(root); -list.remove(0); -Collections.reverse(list); - -Map ctxMap = invocation.getInvocationContext().getContextMap(); -Iterator iterator = list.iterator(); -int index = 1; // starts with 1, 0 has been removed -while (iterator.hasNext()) { -index = index + 1; -Object o = iterator.next(); -if (o != null) { -if (!(o instanceof Unchainable)) { -reflectionProvider.copy(o, invocation.getAction(), ctxMap, excludes, includes); -} -} else { -LOG.warn("compound root element at index " + index + " is null"); +private void copyStack(ActionInvocation invocation, CompoundRoot root) { +List list = prepareList(root); +Map ctxMap = invocation.getInvocationContext().getContextMap(); +for (Object object : list) { +if (shouldCopy(object)) { +reflectionProvider.copy(object, invocation.getAction(), ctxMap, prepareExcludes(), includes); +} +} +} + +private Collection prepareExcludes() { +Collection localExcludes = excludes; +if (!copyErrors || !copyMessages) { +if (localExcludes == null) { +localExcludes = new HashSet(); +if (!copyErrors) { +localExcludes.add(ACTION_ERRORS); +} +if (!copyMessages) { +localExcludes.add(ACTION_MESSAGES); } } } -return invocation.invoke(); +return localExcludes; +} + +private boolean shouldCopy(Object o) { +return o != null && !(o instanceof Unchainable); +} + +@SuppressWarnings("unchecked") +private List prepareList(CompoundRoot root) { +List list = new ArrayList(root); +list.remove(0); +Collections.reverse(list); +return list; } -private boolean isChainResult(ActionInvocation invocation) throws Exception { +
svn commit: r997365 - /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java
Author: lukaszlenart Date: Wed Sep 15 15:23:16 2010 New Revision: 997365 URL: http://svn.apache.org/viewvc?rev=997365&view=rev Log: Reverted setIncludes() implementation (commited by mistake) Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java?rev=997365&r1=997364&r2=997365&view=diff == --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java Wed Sep 15 15:23:16 2010 @@ -211,7 +211,7 @@ public class ChainingInterceptor extends * @param includes the includes list */ public void setIncludes(Collection includes) { -this.includes.addAll(includes); +this.includes = includes; } }
svn commit: r997366 - /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java
Author: lukaszlenart Date: Wed Sep 15 15:26:34 2010 New Revision: 997366 URL: http://svn.apache.org/viewvc?rev=997366&view=rev Log: Updated JavaDoc snippet about copping actionErrors and actionMessages Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java?rev=997366&r1=997365&r2=997366&view=diff == --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java Wed Sep 15 15:26:34 2010 @@ -46,6 +46,9 @@ import java.util.*; * is through the use of the chain result type, which combines with this interceptor to make up the action * chaining feature. * + * + * Note: By default actionErrors and actionMessages are excluded when copping object's properties. + * * * * Interceptor parameters:
[CONF] Confluence Changes in the last 24 hours
This is a daily summary of all recent changes in Confluence. - Updated Spaces: - Apache ActiveMQ (https://cwiki.apache.org/confluence/display/ACTIVEMQ) Pages - REST edited by dejanb (10:06 AM) https://cwiki.apache.org/confluence/display/ACTIVEMQ/REST Apache Camel (https://cwiki.apache.org/confluence/display/CAMEL) Pages - Camel 2.5.0 Release edited by davsclaus (07:59 AM) https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.5.0+Release Stream caching edited by davsclaus (03:55 AM) https://cwiki.apache.org/confluence/display/CAMEL/Stream+caching Apache CXF Documentation (https://cwiki.apache.org/confluence/display/CXF20DOC) Pages - Configuration edited by dkulp (10:41 PM) https://cwiki.apache.org/confluence/display/CXF20DOC/Configuration Apache Etch (https://cwiki.apache.org/confluence/display/ETCH) Pages - Overview edited by grandyho (03:20 AM) https://cwiki.apache.org/confluence/display/ETCH/Overview Home edited by grandyho (02:50 AM) https://cwiki.apache.org/confluence/display/ETCH/Home Index edited by grandyho (01:54 AM) https://cwiki.apache.org/confluence/display/ETCH/Index Apache Geronimo v2.2 (https://cwiki.apache.org/confluence/display/GMOxDOC22) Pages - Converting applications into plugins using the Administration Console edited by maojia508 (02:57 AM) https://cwiki.apache.org/confluence/display/GMOxDOC22/Converting+applications+into+plugins+using+the+Administration+Console Apache Geronimo v3.0 (https://cwiki.apache.org/confluence/display/GMOxDOC30) Pages - gogo commands for Geronimo edited by maojia508 (10:42 PM) https://cwiki.apache.org/confluence/display/GMOxDOC30/gogo+commands+for+Geronimo Running Multiple Geronimo Instances edited by maojia508 (09:23 PM) https://cwiki.apache.org/confluence/display/GMOxDOC30/Running+Multiple+Geronimo+Instances Apache Maven (https://cwiki.apache.org/confluence/display/MAVEN) Pages - Maven 3.x Compatibility Notes edited by denn...@apache.org (04:59 PM) https://cwiki.apache.org/confluence/display/MAVEN/Maven+3.x+Compatibility+Notes Apache Open Relevance (https://cwiki.apache.org/confluence/display/ORP) Pages - Open Relevance Viewer edited by redbeard906 (10:13 PM) https://cwiki.apache.org/confluence/display/ORP/Open+Relevance+Viewer Apache River (https://cwiki.apache.org/confluence/display/RIVER) Pages - Get Involved edited by s...@qcg.nl (06:38 AM) https://cwiki.apache.org/confluence/display/RIVER/Get+Involved Committers edited by s...@qcg.nl (06:33 AM) https://cwiki.apache.org/confluence/display/RIVER/Committers Apache Sling (https://cwiki.apache.org/confluence/display/SLING) Pages - Status Report (September 2010) edited by bdelacretaz (12:05 PM) https://cwiki.apache.org/confluence/display/SLING/Status+Report+%28September+2010%29 Traffic Server (https://cwiki.apache.org/confluence/display/TS) Pages - NewStatsAPI edited by zwoop (11:32 PM) https://cwiki.apache.org/confluence/display/TS/NewStatsAPI Apache Tuscany (https://cwiki.apache.org/confluence/display/TUSCANY) Pages - Tuscany Books and Articles edited by slaws (12:58 PM) https://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+Books+and+Articles Tuscany Downloads & Documentations edited by scnash (06:28 AM) https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=55199 Apache Tuscany Docs 2.x (https://cwiki.apache.org/confluence/display/TUSCANYxDOCx2x) Pages - SCA Java Development Guide edited by slaws (03:23 AM) https://cwiki.apache.org/confluence/display/TUSCANYxDOCx2x/SCA+Java+Development+Guide Apache VCL (https://cwiki.apache.org/confluence/display/VCL) Pages - 2.2 Management Node Installation edited by arkurth (02:03 PM) https://cwiki.apache.org/confluence/display/VCL/2.2+Management+Node+Installation 2.2 Web Code Installation edited by jfthomps (01:10 PM) https://cwiki.apache.org/confluence/display/VCL/2.2+Web+Code+