Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hash Map containing a list in managed-bean config file

 
prasad kolla
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

Is there a way we can define a map containing a list in the faces-config.xml file. I have tried the following way it gives a parse exception.
Hash map contains a key, "value" pair and it expects "value" to be string.

can i place a list inside "value"?

<managed-bean>
<managed-bean-name>buttonMap</managed-bean-name>
<managed-bean-class>java.util.HashMap</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
<map-entries>
<key-class>java.lang.String</key-class>
<value-class>java.util.List</value-class>
<map-entry>
<key>pagename</key>
<value>
<list-entries>
<value-class>java.lang.String</value-class>
<value>value1</value>
<value>value2</value>
<value>value3</value>
</list-entries>
</value>
</map-entry>
</map-entries>
</managed-bean>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic