You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ce...@apache.org on 2002/04/15 10:22:44 UTC
cvs commit: jakarta-struts/contrib/tiles/src/share/org/apache/struts/tiles/xmlDefinition XmlListAttribute.java XmlDefinition.java
cedric 02/04/15 01:22:44
Modified: contrib/tiles/src/share/org/apache/struts/tiles/xmlDefinition
XmlListAttribute.java XmlDefinition.java
Log:
Add inheritance for controllerClass and
controllerUrl attributes (bug reported by Jim Crossley)
Revision Changes Path
1.3 +13 -4 jakarta-struts/contrib/tiles/src/share/org/apache/struts/tiles/xmlDefinition/XmlListAttribute.java
Index: XmlListAttribute.java
===================================================================
RCS file: /home/cvs/jakarta-struts/contrib/tiles/src/share/org/apache/struts/tiles/xmlDefinition/XmlListAttribute.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XmlListAttribute.java 27 Dec 2001 17:35:38 -0000 1.2
+++ XmlListAttribute.java 15 Apr 2002 08:22:44 -0000 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/contrib/tiles/src/share/org/apache/struts/tiles/xmlDefinition/XmlListAttribute.java,v 1.2 2001/12/27 17:35:38 cedric Exp $
- * $Revision: 1.2 $
- * $Date: 2001/12/27 17:35:38 $
+ * $Header: /home/cvs/jakarta-struts/contrib/tiles/src/share/org/apache/struts/tiles/xmlDefinition/XmlListAttribute.java,v 1.3 2002/04/15 08:22:44 cedric Exp $
+ * $Revision: 1.3 $
+ * $Date: 2002/04/15 08:22:44 $
* $Author: cedric $
*
*/
@@ -60,7 +60,16 @@
*/
public void add( Object value )
{
- list.add( value );
+ //list.add( value );
+ // To correct a bug in digester, we need to check the object type
+ // Digester doesn't call correct method according to object type ;-(
+ if(value instanceof XmlAttribute)
+ {
+ add((XmlAttribute)value);
+ return;
+ }
+ else
+ list.add( value );
}
/**
1.5 +10 -0 jakarta-struts/contrib/tiles/src/share/org/apache/struts/tiles/xmlDefinition/XmlDefinition.java
Index: XmlDefinition.java
===================================================================
RCS file: /home/cvs/jakarta-struts/contrib/tiles/src/share/org/apache/struts/tiles/xmlDefinition/XmlDefinition.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XmlDefinition.java 27 Dec 2001 17:35:38 -0000 1.4
+++ XmlDefinition.java 15 Apr 2002 08:22:44 -0000 1.5
@@ -132,6 +132,11 @@
setPath( parent.getPath() );
if( role == null )
setRole( parent.getRole() );
+ if( controller==null )
+ {
+ setController( parent.getController());
+ setControllerType( parent.getControllerType());
+ }
}
/**
@@ -154,6 +159,11 @@
if( child.getRole() != null )
{
role = child.getRole();
+ }
+ if( child.getController()!=null )
+ {
+ controller = child.getController();
+ controllerType = child.getControllerType();
}
// put all child attributes in parent.
attributes.putAll( child.getAttributes());
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>