struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r1133658 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java
Date Thu, 09 Jun 2011 05:29:38 GMT
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<String,Object> dynamicAttributes = new HashMap<String,Object>();
+    protected Map<String, Object> dynamicAttributes = new HashMap<String, Object>();
 
     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);
         }



Mime
View raw message