commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wer...@apache.org
Subject cvs commit: jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl StaticTagScript.java
Date Sat, 01 Mar 2003 21:01:05 GMT
werken      2003/03/01 13:01:05

  Modified:    jelly/src/java/org/apache/commons/jelly/impl
                        StaticTagScript.java
  Log:
  Small fix to allow a DynaTag, which masked as a StaticTag, to
  actually have an Expression received for setAttribute().
  
  Previously, when hidden by the StaticTag, the getAttributeType()
  method was ignored and all expressions were evaluate()'d prior
  to the call to setAttribute().  Simply added a check for
  getAttributeType().
  
  Revision  Changes    Path
  1.17      +8 -1      jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/StaticTagScript.java
  
  Index: StaticTagScript.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/StaticTagScript.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- StaticTagScript.java	31 Jan 2003 23:50:51 -0000	1.16
  +++ StaticTagScript.java	1 Mar 2003 21:01:05 -0000	1.17
  @@ -137,7 +137,14 @@
                   String name = (String) entry.getKey();
                   Expression expression = (Expression) entry.getValue();
       
  -                Object value = expression.evaluate(context);
  +                Object value = null;
  +
  +                if ( Expression.class.isAssignableFrom( dynaTag.getAttributeType(name)
) ) {
  +                    value = expression;
  +                } else {
  +                    value = expression.evaluate(context);
  +                }
  +
                   dynaTag.setAttribute(name, value);
               }
           
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message