|
I found the solution just
a moment ago. I have just to add the
classes of the keys and values. <map-entries> <key-class>java.lang.String</key-class> <value-class>java.lang.Object</value-class> <map-entry> <key>submissionDate</key> <value>#{Range}</value> </map-entry> </map-entries> From:
Hi all, I don't get a map entry of my managed bean
initialized with an object value. Instead it contains only a String with the class
name. Snippets: First I have a bean called Range. <managed-bean> <managed-bean-name>Range</managed-bean-name>
<managed-bean-class>xxx.search.Range</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>from</property-name>
<value>testValue</value>
</managed-property> </managed-bean> This bean should be used in another bean: <managed-bean>
<managed-bean-name>Search</managed-bean-name>
<managed-bean-class>xxx.Search</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>attributes</property-name>
<map-entries>
<map-entry>
<key>submissionDate</key>
<value>#{Range}</value>
</map-entry>
</map-entries>
</managed-property> </managed-bean> public class Search implements java.io.Serializable { private Map<String,
Object> attributes;
public Map<String, Object> getAttributes()
{...}
public void setAttributes(Map<String, Object> attributes) {....} ... } Class xxx.Search contains a Map called attributes. Now I want to initialize this map with an entry of
type Range. The problem is that the Map attributes contains only
a String "[EMAIL PROTECTED]" instead of the Range object. Range and Search are both serializeable. What's going wrong here? Is it generally possible to init collections with
objects? Michael |

