I couldn't find my previous email on the SF list yet to keep this reply there, but I believe I understand now why the velocity directives act the way they do. In my post, I indicated that it would be easier to pass objects from the velocity context into bodytag params if you could do so without popping things onto the stack. For example, where this works now,
#foreach ($item in $myItems) $stack.push($item) #bodytag(Component template="mytemplate.vm") #param("param1" "$item") #end #set ($item = $stack.pop()) #end , the following would be preferable:
#foreach ($item in $myItems) #bodytag(Component template="mytemplate.vm") #param("param1" $item) #end #end
+1 I went ahead and made this change to CVS. Also, I fixed another issue with the velocity directives where the attributes were being set before doStartTag() was called.
The net result is that calling:
#tag( Component "template=mytemplate.vm" "params.param1=foo" )
is now valid. For consistency, you'll need to put the 's around the value unless you want the value to be rendered against the value stack.
As another option, I would write the above loop as:
#foreach( $item in $myItems ) #tag( Component ... "params.param1=myItems[$velocityCount]" ) #end
assuming that $velocityCount is 0 indexed and myItems can be resolved on the value stack.
M
------------------------------------------------------- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork