This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSF and the fly likes Hash Map containing a list in managed-bean config file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "Hash Map containing a list in managed-bean config file" Watch "Hash Map containing a list in managed-bean config file" New topic
Author

Hash Map containing a list in managed-bean config file

prasad kolla
Greenhorn

Joined: Jul 19, 2008
Posts: 12
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>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Hash Map containing a list in managed-bean config file
 
It's not a secret anymore!