I'm not sure either, and i'm curious, but don't have time to
investigate at the moment.  It may have something to do with the fact
that for Map<String,String>, there really ought not be a get(Object)
to override, right?.  I'm not sure why the compiler doesn't complain
about that when you compile your class.  Not that that makes it clear
why it can't find your public method.

Anyway, is this with Velocity 1.7?  If you would like, you could file
a bug report at http://issues.apache.org to increase the chances that
i (or someone else) will look into it later.

On Thu, Jun 30, 2011 at 7:21 AM, matela <[email protected]> wrote:
>
>
> OK, I've found some kind of workaround: in addition to overriding the
> get(Object key) method in my map, I need to add this method:
>
> public String get(String key) {
>    return get((Object) key);
> }
>
> Now it works as I intended, but I still completely don't understand why
> Velocity engine behaves this way. So any comments will be appriciated.
>
> Cheers,
> Mateusz Matela
>
>
> matela wrote:
>>
>> My output is this: ${params.get("a")}
>> instead of this: aaa
>>
>> What is the most strange to me, is that the example works fine if I remove
>> the get method from the Params class, even though the override method does
>> nothing but call the super method.
>> Can anyone tell me what's going on?
>>
>
> --
> View this message in context: 
> http://old.nabble.com/Can%27t-acces-map-values-when-get%28%29-is-overriden-tp31955214p31963582.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]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to