struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rafert, Tim" <traf...@tanning.com>
Subject RE: Digester addCallParam question
Date Wed, 01 Aug 2001 20:55:43 GMT
Of course - as soon as I sent the email - I found the correct 3 parameter
method addCallParam which includes the attribute name as the 3rd param.
 
Sorry for the needless emails...
 

-----Original Message-----
From: Rafert, Tim 
Sent: Wednesday, August 01, 2001 2:49 PM
To: 'struts-user@jakarta.apache.org'
Subject: Digester addCallParam question


Should the addCallParam be able to pass attributes (not just element body
values)?
 
Sample xml:
 
<thing-definition>
  <thing name="name1">
    <config key="theKey" value="theValue"/>
  </thing>
</thing-definition>
 
Sample code:
      aDigester.addObjectCreate("thing-definition/thing","ThingClass");
      aDigester.addSetProperties("thing-definition/thing");
 
aDigester.addCallMethod("thing-definition/thing/config","addConfig",2);
      aDigester.addCallParam("key",0);
      aDigester.addCallParam("value",1); 
 
I cannot seem to get the addCallParam calls to work referencing attributes
of the config element (nulls are always passed in to the addConfig method).
I can change the xml to to make key and value actual elements and read the
values from the body and reference them within addCallParam via
"thing-definition/thing/config/key" - but was hoping to avoid that...
 
The docs say:
"You can specify that the parameter value be taken from a particular named
attribute, or from the nested body content of this element"
 
BUT I don't see anyway to reference the named attribute here...  What am I
missing?
 
Thanks!!
 
Tim Rafert

 


Mime
View raw message