Announcement Announcement Module
Collapse
No announcement yet.
Key type other than String Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Key type other than String

    After looking through the documentation, mailing lists, and this forum, it appears that the key of a map within the application context can only be a string.

    Code:
    <map>
       <entry key="string">
           <value>"the value"</value>
       </entry>
     </map>
    Is there a way around this? I'd like use instances of my own class as the key.
    I found a few discussions on this topic but no resolution. Unless, of course there isn't one.

    Thanks.

  • #2
    mfuller,

    There is a JIRA entry for this issue Allow <map> keys that are not strings.

    As a workaround, you can create a FactoryBean that accepts two lists (key, values) and build a Map.
    HTH

    Comment


    • #3
      Thanks. I'll check out your suggestion.

      Comment

      Working...
      X