Cool, thanks! Now I look at the Velocity user guide and find this:
*"$customer.Address*. It can have two meanings. It can mean, Look in the
hashtable identified as *customer* and return the value associated with the
key *Address*. But *$customer.Address* can also be referring to a method
(references that refer to methods will be discussed in the next section); *
$customer.Address* could be an abbreviated way of writing *
$customer.getAddress()*."
so, one more question, if I have both the get(String s) and the getAddress()
methods for the Customer object. In the template, I have $customer.Address,
Which method would take precedence? customer.get("address") or
customer.getAddress()?
Jian
On 7/7/06, Will Glass-Husain <[EMAIL PROTECTED]> wrote:
yes.
WILL
jian chen wrote:
> Hi, All,
>
> As a long term Velocity user, I think I have been pretty savvy for
> Velocity
> usage. Still got a question to ask though.
>
> If I put a HashMap in the Velocity template,
>
> HashMap map = new HashMap();
> map.put("aKey", "aValue");
> ctx.put("map", map);
>
> I can retrieve the value in the template by: $map.aKey.
>
> I tried to find relevant info. in Velocity user guide, but couldn't
> find any
> relating this usage.
>
> So, is it that $map.aKey is the same as $map.get("aKey")?
>
> Thanks,
>
> Jian
>
--
Forio Business Simulations
Will Glass-Husain
phone (415) 440-7500 x89
mobile (415) 235-4293
[EMAIL PROTECTED]
www.forio.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]