struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ced...@apache.org
Subject cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/tiles GetAttributeTag.java PutTag.java
Date Thu, 11 Jul 2002 16:54:33 GMT
cedric      2002/07/11 09:54:33

  Modified:    src/share/org/apache/struts/taglib/tiles
                        GetAttributeTag.java PutTag.java
  Log:
  Correct a bug encountered with Orion.
  
  Change the way the body value is detected and stored in the class. Now, the
  attribute 'value' is correctly released after the tag call.
  
  Revision  Changes    Path
  1.2       +4 -3      jakarta-struts/src/share/org/apache/struts/taglib/tiles/GetAttributeTag.java
  
  Index: GetAttributeTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/tiles/GetAttributeTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GetAttributeTag.java	25 Jun 2002 03:16:30 -0000	1.1
  +++ GetAttributeTag.java	11 Jul 2002 16:54:33 -0000	1.2
  @@ -172,6 +172,7 @@
         throw new JspException ( "Error - tag.getProperty : IOException ");
         }
   
  +    release();
       return EVAL_PAGE;
     }
   }
  
  
  
  1.2       +18 -16    jakarta-struts/src/share/org/apache/struts/taglib/tiles/PutTag.java
  
  Index: PutTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/tiles/PutTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PutTag.java	25 Jun 2002 03:16:30 -0000	1.1
  +++ PutTag.java	11 Jul 2002 16:54:33 -0000	1.2
  @@ -315,10 +315,21 @@
           // Compute real value from attributes set.
       realValue = value;
   
  +        // If realValue is not set, value must come from body
  +    if( value == null && beanName == null )
  +        {
  +          // Test body content in case of empty body.
  +        if( bodyContent != null )
  +          realValue = bodyContent.getString();
  +         else
  +          realValue = "";
  +        }
  +
           // Does value comes from a bean ?
  -      if( value == null && beanName != null )
  +      if( realValue == null && beanName != null )
           {
           getRealValueFromBean();
  +        return;
           } // end if
   
         // Is there a type set ?
  @@ -333,9 +344,9 @@
           valueType = "path";
         }  // end if
   
  -    if( value != null && valueType!=null && !(value instanceof AttributeDefinition)
)
  +    if( realValue != null && valueType!=null && !(value instanceof AttributeDefinition)
)
         {
  -      String strValue = value.toString();
  +      String strValue = realValue.toString();
           if( valueType.equalsIgnoreCase( "string" ) )
             {
             realValue = new DirectStringAttribute( strValue );
  @@ -422,17 +433,8 @@
        */
     public int doEndTag() throws JspException
       {
  -        // If nothing is set, value must come from body
  -    if( value == null && beanName == null )
  -        {  // body
  -          // Test body content in case of empty body.
  -        if( bodyContent != null )
  -          value = bodyContent.getString();
  -         else
  -          value = "";
  -        }
  +      // Call parent tag which in turn do what it want
       callParent();
  -
           // clean up tag handler for reuse.
       releaseInternal();
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message