You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ar...@apache.org on 2002/01/23 00:27:49 UTC
cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/nested NestedPropertyHelper.java
arron 02/01/22 15:27:49
Modified: src/share/org/apache/struts/taglib/nested
NestedPropertyHelper.java
Log:
Allowing the relative property, to access the parent's qualified property itself.
Iterate logic has *no* way of accessing the qualified indexed object correctly (including index), only its child properties.
Use of a special relative property "./" would represent the parent object directly, indexed or otherwise.
Revision Changes Path
1.3 +10 -4 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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NestedPropertyHelper.java 22 Jan 2002 03:30:50 -0000 1.2
+++ NestedPropertyHelper.java 22 Jan 2002 23:27:48 -0000 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/NestedPropertyHelper.java,v 1.2 2002/01/22 03:30:50 arron Exp $
- * $Revision: 1.2 $
- * $Date: 2002/01/22 03:30:50 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/NestedPropertyHelper.java,v 1.3 2002/01/22 23:27:48 arron Exp $
+ * $Revision: 1.3 $
+ * $Date: 2002/01/22 23:27:48 $
* ====================================================================
*
* The Apache Software License, Version 1.1
@@ -76,7 +76,7 @@
*
* @author Arron Bates
* @since Struts 1.1
- * @version $Revision: 1.2 $ $Date: 2002/01/22 03:30:50 $
+ * @version $Revision: 1.3 $ $Date: 2002/01/22 23:27:48 $
*/
public class NestedPropertyHelper {
@@ -231,6 +231,12 @@
* @return qualified nested property that the property param is to the parent
*/
private static String getRelativeProperty(String property, String parent) {
+
+ /* Special case... reference my parent's nested property.
+ Otherwise impossible for things like indexed properties */
+ if ("./".equals(property)) {
+ return parent;
+ }
/* remove the stepping from the property */
String stepping = property.substring(0,property.lastIndexOf('/')+1);
/* isolate the property */
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>