velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rickard Öberg <rick...@xpedio.com>
Subject Re: Indexed getters
Date Tue, 27 Nov 2001 16:00:14 GMT
Geir Magnusson Jr. wrote:

>>>-----Original Message-----
>>>From: Stephane MOR [mailto:stephanemor@yahoo.fr]
>>>Sent: Tuesday, November 27, 2001 10:22 AM
>>>
>><snip>
>>
>>>Then, in the template, you can use :
>>>
>>>$foo.getBar("blahblah")
>>>
>>>to get the returned String.
>>>
>>>
>>That is how I understand it as well, but it doesn't work that way for me. I
>>am relying on webwork to provide the "context". It has a servlet that
>>extends VelocityServlet that provides the WebWork context object
>>(ValueStack) to the VelocityEngine. Perhaps there is a problem with this
>>process.
>>
>>
> 
> Hm.  I would bet that WebWork works :) do you put the object into the
> context, or does webwork do it for you?


WebWork puts the action into the context, so that all properties of the action can be accessed
in the page.


Thus, if you use $foo it will be evaluated in WebWork to 
<theaction>.getFoo().

However, if you use $foo.bar this will be evaluated to 
<theaction>.getFoo() in WebWork, but getBar() will be done by Velocity. 
WebWork is only in charge of the first part of the value resolution.

/Rickard

-- 
Rickard Öberg


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message