arron       02/02/11 23:01:58

  Modified:    src/share/org/apache/struts/taglib/nested
                        NestedPropertyHelper.java
  Log:
  Bug with backward stepping and the parent reference.
  
  Revision  Changes    Path
  1.5       +11 -12    
jakarta-struts/src/share/org/apache/struts/taglib/nested/NestedPropertyHelper.java
  
  Index: NestedPropertyHelper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/NestedPropertyHelper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NestedPropertyHelper.java 23 Jan 2002 06:38:22 -0000      1.4
  +++ NestedPropertyHelper.java 12 Feb 2002 07:01:57 -0000      1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/NestedPropertyHelper.java,v
 1.4 2002/01/23 06:38:22 arron Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/01/23 06:38:22 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/NestedPropertyHelper.java,v
 1.5 2002/02/12 07:01:57 arron Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/02/12 07:01:57 $
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
  @@ -76,7 +76,7 @@
    *
    * @author Arron Bates
    * @since Struts 1.1
  - * @version $Revision: 1.4 $ $Date: 2002/01/23 06:38:22 $
  + * @version $Revision: 1.5 $ $Date: 2002/02/12 07:01:57 $
    */ 
   public class NestedPropertyHelper {
     
  @@ -272,17 +272,16 @@
           StringBuffer result = new StringBuffer();
           for (int i = 0; i < count; i++) {
             result.append(proT.nextToken());
  -          
  -          /* don't place dot if there's no property to append afterwards
  -             (for parent referencing) */
  -          if ((i == (count-1)) && (property.length() > 0)) {
  -            result.append('.');
  -          }
  +          result.append('.');
           }
           result.append(property);
           
  -        /* return stepped property */
  -        return result.toString();
  +        /* parent reference will have a dot on the end. Leave it off */
  +        if (result.charAt(result.length()-1) == '.') {
  +          return result.substring(0,result.length()-1);
  +        } else {
  +          return result.toString();
  +        }
         }
       }
     }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to