You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by pe...@mindspring.com on 2001/10/11 21:06:29 UTC

java.util.Map and get() not working??

I am experiencing the following problem with a HashMap in the context:

I add the following object into the context:
ConstantTool
 - getFeature() returns a private populated Map (app=featurelist)

In my template:
$CONSTANT.feature or $CONSTANT.getFeature() returns the Map and the toString() gets called. That is what I expect I guess, so I see:

{fooapp=com.foo.blah.ConstantTool$FeatureSet@724a9d}

in my template.

but calling:
$CONSTANT.feature.fooapp

does not seem to call the get(String key) of the HashMap to lookup "fooapp" and return the associated object. FeatureSet being a private class of the ConstantTool

So I am sure that fooapp is in the map. Why doesn't the Map get method return an object in this case in this case?

-Peter