Could it be that your key is Integer?

When you access it in Velocity, you are accessing it as string for the key?

Jian
http://www.JiansNet.com
Bilingual English/Chinese site for overseas Chinese and English speakers

On Tue, Mar 10, 2009 at 2:36 PM, scadh <[email protected]> wrote:

>
> I have a Controller method that returns a ModelAndView. The pertinent part
> of
> the code is:
>
> {
> Map model = new HashMap();
> model.put("pageValues", contentService.getPageValues(channel,
> landingName).getValues());
>
> return new ModelAndView("nominate/landing", model);
> }
>
> The getValues() method returns a Map, which I put into the model with key
> "pageValues".
>
> I am unable to directly reference any values in the Map in the view. I
> expected this to work, but it doesn't:
>
> $pageValues.get("key")
>
> However, when referenced indirectly from within a foreach loop, it works
> fine:
>
> #foreach($key in $pageValues.keySet())
>    <li>$key > $pageValues.get($key)</li>
> #end
>
> Is my syntax incorrect attempting to access a Map inside another Map? Can't
> seem to figure it out, and time is short! I would greatly appreciate any
> assistance that anyone could provide.
> --
> View this message in context:
> http://www.nabble.com/Trouble-accessing-Map-values-in-Velocity-tp22444107p22444107.html
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to