velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rickard Öberg <>
Subject Re: Indexed getters
Date Tue, 27 Nov 2001 16:09:10 GMT
James Cook wrote:

> It appears that the ValueStack is more restrictive on the methods it exposes
> than a typical Velocity context.

I don't think so. If you feed in "getNumber(5)" it should get back the 
same thing as you'd expect from Velocity. However, the question is: are 
method lookups processed against the context at all? I would guess not. 
AFAICT the first part after $ is always a context lookup name. This is 
why your output is (5), since Velocity will parse to getNumber, and then 
it will stop, since there is no . to access the next part (which could 
be "getFoo(12)" or similar).

It might be possible to get it to work if you can somehow access the top 
of the stack of WebWork with the first name. "." does that, i.e. 
"$..getNumber(5)" would work (since . would resolve to your action), 
although I'm not sure that is valid Velocity syntax :-)


Rickard Öberg

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message