Results 1 to 3 of 3

Thread: Key type other than String

  1. #1

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    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
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3

    Default

    Thanks. I'll check out your suggestion.

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  3. Replies: 4
    Last Post: Aug 17th, 2005, 04:42 AM
  4. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  5. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •