Dear Wiki user, You have subscribed to a wiki page or wiki category on "Jakarta-commons Wiki" for change notification.
The following page has been changed by AndrewKnowles: http://wiki.apache.org/jakarta-commons/BeanUtils/FAQ ------------------------------------------------------------------------------ Now the build system has moved to Maven that won't happen again. + + === Why do I get ClassCastException when accessing nested maps? === + + Say you have a map which contains a nested map ala: + nestedmap.put ("key2", "somevalue"); + map.put ("key1", nestedmap); + + If you use the following syntax: + String val = PropertyUtils.getProperty(bean, "map(key1)(key2)"); + + It will actually return "map(key1)", which will be a Map, not a String. + + BeanUtils uses '.' as a property separator, and the second property should actually used mapped syntax, since it is directly accessing a map now, thus the correct usage should be: + String val = PropertyUtils.getProperty(bean, "map(key1).key2"); + --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]