Title: Message
You could bind it into a different name above the for loop and use that other name... this should make it only call the getter once.
-----Original Message-----
From: Hans Prueller [mailto:[EMAIL PROTECTED]
Sent: Friday, February 20, 2004 10:13 AM
To: [EMAIL PROTECTED]
Subject: Spam:[OS-webwork] WW2 Actions Velocity Result - getters called multiple?

is is the normal case that an Actions getXXX() method is called every time a velocity-result template uses the $XXX variable?
 
if my action has a method, say HashMap getLabelsForType() and it is used in velocity result like
 
#foreach ($type in $types)
    <td> $labelsForType.get($type) </td>
#end
 
the method getLabelsForType is called for every iteration of the foreach loop. I tought the returned HashMap of getLabelsForType() is
put into the velocity context before rendering and thats it...
 
is that my mistake or is there a deeper sense???
 
thanx in advance,
Hans

Reply via email to