svn commit: r1133590 - in /struts/struts2/trunk: plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java xwork-core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.j

2011-06-08 Thread jafl
Author: jafl
Date: Wed Jun  8 22:40:33 2011
New Revision: 1133590

URL: http://svn.apache.org/viewvc?rev=1133590&view=rev
Log:
WW-3518 remove duplicated code from RestActionInvocation

Modified:

struts/struts2/trunk/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java

struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java

Modified: 
struts/struts2/trunk/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java?rev=1133590&r1=1133589&r2=1133590&view=diff
==
--- 
struts/struts2/trunk/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java
 (original)
+++ 
struts/struts2/trunk/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java
 Wed Jun  8 22:40:33 2011
@@ -56,11 +56,11 @@ import org.apache.struts2.rest.handler.H
  * as well as apply content type-specific operations to the result.
  */
 public class RestActionInvocation extends DefaultActionInvocation {
-
+
 private static final long serialVersionUID = 3485701178946428716L;
 
 private static final Logger LOG = 
LoggerFactory.getLogger(RestActionInvocation.class);
-
+
 private ContentTypeHandlerManager handlerSelector;
 private boolean logger;
 private String defaultErrorResultName;
@@ -69,89 +69,25 @@ public class RestActionInvocation extend
 protected Object target;
 protected boolean isFirstInterceptor = true;
 protected boolean hasErrors;
-
+
 protected RestActionInvocation(Map extraContext, boolean pushAction) {
 super(extraContext, pushAction);
 }
 
 @Inject("struts.rest.logger")
 public void setLogger(String value) {
-logger = new Boolean(value); 
+logger = new Boolean(value);
 }
-
+
 @Inject("struts.rest.defaultErrorResultName")
 public void setDefaultErrorResultName(String value) {
-defaultErrorResultName = value; 
+defaultErrorResultName = value;
 }
-
+
 @Inject
 public void setMimeTypeHandlerSelector(ContentTypeHandlerManager sel) {
 this.handlerSelector = sel;
 }
-
-protected String invokeAction(Object action, ActionConfig actionConfig) 
throws Exception {
-String methodName = proxy.getMethod();
-
-if (LOG.isDebugEnabled()) {
-LOG.debug("Executing action method = " + 
actionConfig.getMethodName());
-}
-
-String timerKey = "invokeAction: "+proxy.getActionName();
-try {
-UtilTimerStack.push(timerKey);
-
-boolean methodCalled = false;
-Object methodResult = null;
-Method method = null;
-try {
-method = getAction().getClass().getMethod(methodName, new 
Class[0]);
-} catch (NoSuchMethodException e) {
-// hmm -- OK, try doXxx instead
-try {
-String altMethodName = "do" + methodName.substring(0, 
1).toUpperCase() + methodName.substring(1);
-method = getAction().getClass().getMethod(altMethodName, 
new Class[0]);
-} catch (NoSuchMethodException e1) {
-// well, give the unknown handler a shot
-if (unknownHandlerManager.hasUnknownHandlers()) {
-try {
-methodResult = 
unknownHandlerManager.handleUnknownMethod(action, methodName);
-methodCalled = true;
-} catch (NoSuchMethodException e2) {
-// throw the original one
-throw e;
-}
-} else {
-throw e;
-}
-}
-}
-
-if (!methodCalled) {
-methodResult = method.invoke(action, new Object[0]);
-}
-
-return saveResult(actionConfig, methodResult);
-} catch (NoSuchMethodException e) {
-throw new IllegalArgumentException("The " + methodName + "() is 
not defined in action " + getAction().getClass() + "");
-} catch (InvocationTargetException e) {
-// We try to return the source exception.
-Throwable t = e.getTargetException();
-
-if (actionEventListener != null) {
-String result = actionEventListener.handleException(t, 
getStack());
-if (result != null) {
-return result;
-}
-}
-if (t instanceof Exception) {
-throw(Exception) t;
-} else {
-throw e;
-}
-} finally {
-UtilTimerStack.pop

[CONF] Confluence Changes in the last 24 hours

2011-06-08 Thread confluence
This is a daily summary of all recent changes in Confluence.

-
Updated Spaces:
-


Apache Amber (https://cwiki.apache.org/confluence/display/AMBER)

Pages
-
People created by lmo...@apache.org (12:55 PM)
https://cwiki.apache.org/confluence/display/AMBER/People

Commercial Amber Offerings created by lmo...@apache.org (12:37 PM)
https://cwiki.apache.org/confluence/display/AMBER/Commercial+Amber+Offerings

Graphics created by lmo...@apache.org (12:37 PM)
https://cwiki.apache.org/confluence/display/AMBER/Graphics

Deployments created by lmo...@apache.org (12:07 PM)
https://cwiki.apache.org/confluence/display/AMBER/Deployments

Extenions created by lmo...@apache.org (11:46 AM)
https://cwiki.apache.org/confluence/display/AMBER/Extenions

Get Involved created by lmo...@apache.org (11:42 AM)
https://cwiki.apache.org/confluence/display/AMBER/Get+Involved

Resource Server created by lmo...@apache.org (11:40 AM)
https://cwiki.apache.org/confluence/display/AMBER/Resource+Server

Authorization Server created by lmo...@apache.org (11:38 AM)
https://cwiki.apache.org/confluence/display/AMBER/Authorization+Server

OAuth 2.0 Client Quickstart created by lmo...@apache.org (11:25 AM)
https://cwiki.apache.org/confluence/display/AMBER/OAuth+2.0+Client+Quickstart

Downloads created by lmo...@apache.org (10:57 AM)
https://cwiki.apache.org/confluence/display/AMBER/Downloads

OAuth 2.0 Demo created by lmo...@apache.org (10:35 AM)
https://cwiki.apache.org/confluence/display/AMBER/OAuth+2.0+Demo

Apache Amber Home edited by  lmo...@apache.org  (10:34 AM)
https://cwiki.apache.org/confluence/display/AMBER/Apache+Amber+Home

Mailing List created by lmo...@apache.org (10:23 AM)
https://cwiki.apache.org/confluence/display/AMBER/Mailing+List



Apache Felix (https://cwiki.apache.org/confluence/display/FELIX)

Pages
-
Apache Felix Dependency Manager - OSGi Design Patterns edited by  marrs  (03:49 
PM)
https://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Dependency+Manager+-+OSGi+Design+Patterns



Apache Geronimo v2.2 (https://cwiki.apache.org/confluence/display/GMOxDOC22)

Pages
-
Deploying and debugging applications using GEP edited by  chirun...@gmail.com  
(01:34 AM)
https://cwiki.apache.org/confluence/display/GMOxDOC22/Deploying+and+debugging+applications+using+GEP



Apache Geronimo v3.0 (https://cwiki.apache.org/confluence/display/GMOxDOC30)

Pages
-
Deploying and debugging applications using GEP edited by  chirun...@gmail.com  
(01:35 AM)
https://cwiki.apache.org/confluence/display/GMOxDOC30/Deploying+and+debugging+applications+using+GEP



Apache Isis (https://cwiki.apache.org/confluence/display/ISIS)

Pages
-
Viewer-agnostic Network Protocol edited by  danhaywood  (01:28 PM)
https://cwiki.apache.org/confluence/display/ISIS/Viewer-agnostic+Network+Protocol

Index edited by  danhaywood  (01:28 PM)
https://cwiki.apache.org/confluence/display/ISIS/Index



Apache Jackrabbit (https://cwiki.apache.org/confluence/display/JCR)

Pages
-
Welcome to Apache Jackrabbit edited by  jukka  (06:06 AM)
https://cwiki.apache.org/confluence/display/JCR/Welcome+to+Apache+Jackrabbit



OFBiz (Open For Business) Project Open Wiki 
(https://cwiki.apache.org/confluence/display/OFBIZ)

Pages
-
Code and test separation for Apache OFBiz edited by  ganathr  (11:42 PM)
https://cwiki.apache.org/confluence/display/OFBIZ/Code+and+test+separation+for+Apache+OFBiz

In The News edited by  jacques.le.roux  (03:57 AM)
https://cwiki.apache.org/confluence/display/OFBIZ/In+The+News



Apache Tapestry (https://cwiki.apache.org/confluence/display/TAPESTRY)

Pages
-
Confluence Site Setup edited by  bobharner  (08:12 PM)
https://cwiki.apache.org/confluence/display/TAPESTRY/Confluence+Site+Setup

Developer Bible edited by  bobharner  (07:57 PM)
https://cwiki.apache.org/confluence/display/TAPESTRY/Developer+Bible

Committers edited by  bobharner  (06:38 AM)
https://cwiki.apache.org/confluence/display/TAPESTRY/Committers

Contributors edited by  bobharner  (06:23 AM)
https://cwiki.apache.org/confluence/display/TAPESTRY/Contributors



Traffic Server (https://cwiki.apache.org/confluence/display/TS)

Pages
-
Filing useful bug reports created by zwoop (01:04 PM)
https://cwiki.apache.org/confluence/display/TS/Filing+useful+bug+reports




svn commit: r1133658 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java

2011-06-08 Thread lukaszlenart
Author: lukaszlenart
Date: Thu Jun  9 05:29:38 2011
New Revision: 1133658

URL: http://svn.apache.org/viewvc?rev=1133658&view=rev
Log:
WW-3644 - check if evaluated expression is not null

Modified:

struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java?rev=1133658&r1=1133657&r2=1133658&view=diff
==
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java
 Thu Jun  9 05:29:38 2011
@@ -32,7 +32,6 @@ import java.util.Map;
 
 /**
  * Abstract base class for all UI tags.
- *
  */
 public abstract class AbstractUITag extends ComponentTagSupport implements 
DynamicAttributes {
 protected String cssClass;
@@ -80,7 +79,7 @@ public abstract class AbstractUITag exte
 protected String tooltipIconPath;
 
 // dynamic attributes.
-protected Map dynamicAttributes = new 
HashMap();
+protected Map dynamicAttributes = new HashMap();
 
 protected void populateParams() {
 super.populateParams();
@@ -292,7 +291,16 @@ public abstract class AbstractUITag exte
 
 public void setDynamicAttribute(String uri, String localName, Object 
value) throws JspException {
 if (value != null && value instanceof String) {
-dynamicAttributes.put(localName, findValue(value.toString()));
+evaluateValue(localName, value);
+} else {
+dynamicAttributes.put(localName, value);
+}
+}
+
+private void evaluateValue(String localName, Object value) {
+Object evaluatedValue = findValue(value.toString());
+if (evaluatedValue != null) {
+dynamicAttributes.put(localName, evaluatedValue);
 } else {
 dynamicAttributes.put(localName, value);
 }