Author: apetrelli
Date: Mon Sep  4 04:24:14 2006
New Revision: 440031

URL: http://svn.apache.org/viewvc?view=rev&rev=440031
Log:
SB-34
Now if the value is an instance of ComponentAttribute, the "real" value is the 
the one that ComponentAttribute.getValue() returns

Modified:
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ImportAttributeTag.java

Modified: 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ImportAttributeTag.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ImportAttributeTag.java?view=diff&rev=440031&r1=440030&r2=440031
==============================================================================
--- 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ImportAttributeTag.java
 (original)
+++ 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ImportAttributeTag.java
 Mon Sep  4 04:24:14 2006
@@ -26,6 +26,7 @@
 import javax.servlet.jsp.tagext.TagSupport;
 
 import org.apache.tiles.taglib.util.TagUtils;
+import org.apache.tiles.ComponentAttribute;
 import org.apache.tiles.ComponentContext;
 
 
@@ -152,11 +153,14 @@
       {
       Object value = compContext.getAttribute(name);
         // Check if value exist and if we must send a runtime exception
-      if( value == null )
+      if( value == null ) {
         if(!isErrorIgnored)
           throw new JspException ( "Error - tag importAttribute : property '"+ 
 name + "' not found in context. Check tag syntax" );
          else
           return SKIP_BODY;
+      } else if (value instanceof ComponentAttribute) {
+        value = ((ComponentAttribute) value).getValue();
+      }
 
       pageContext.setAttribute(name, value, scope);
       }
@@ -180,6 +184,8 @@
             throw new JspException ( "Error - tag importAttribute : property 
'"+ name + "' has a value of 'null'" );
           else
             return SKIP_BODY;
+        } else if (value instanceof ComponentAttribute) {
+          value = ((ComponentAttribute) value).getValue();
         }
         pageContext.setAttribute(name, value, scope);
         } // end loop


Reply via email to