I had noticed the behavior before, which was automatically calling
stack.findValue(), and expressed my opinion that this was problematic when
using velocity, especially when trying to use the component tag. The biggest
problem that the former behavior had, that the latest update fixes, is that
I couldn't pass an object from the velocity page into a component tag. For
example, using the current code, I can now do this:

#foreach ($item in $items)
#bodytag(Component template="template.vm")
#param("param1" "string value")
#param("param2" $item)
#end
#end 

Notice how for the second parameter, I'm directly passing in the item
object, and my template.vm file can deal with $item as an object, not as its
string value. To do this otherwise requires an ugly hack, pushing the $item
object onto the stack. This seemed (to me) like an unnecessary step, and
inconsistent with how velocity tags and macros normally work. 

Note that even with the changes, you can still get your desired behavior,
though you'd have to explicitly call findValue. The #param directive above
could be rewritten as 
#param("param2" $stack.findValue($item))

I think having the option is nice, and also think that not calling
$stack.findValue behind the scenes in the directive allows for more
powerful, expressive templates.

Drew

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Fred
Lamuette
Sent: Monday, November 17, 2003 6:34 AM
To: [EMAIL PROTECTED]
Subject: [OS-webwork] Param directive

Having the latest XWork+WW2 cvs snapshot, I can notice a behavior change for
the param directive.

Before
 #param("paramName" "paramValue") -> store in the parameters list, the value
OgnlValueStack.findValue(paramValue)
>From now
 #param("paramName" "paramValue") -> store in the parameters list, the value
paramValue

Why did you change the previous behavior ?

Richard HALLIER
Chef de projet
[EMAIL PROTECTED]
01.40.12.41.52
www.uniclick.org
UNICLICK








-------------------------------------------------------
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

Reply via email to