Skip navigation
FidelGonzo
Currently Being Moderated

BlazeDS serialization question

Oct 25, 2010 5:29 AM

I recently came into a situation when sending a nested object from Java to Flex via a HashMap the Objects were null. More precisely:

final Map<Integer, List<String>> tempMap = new HashMap<Integer, List<String>>();

would send the keys as integers but the values were all null.

 

But when sending the same with String keys:

final Map<String, List<String>> tempMap = new HashMap<String, List<String>>();

the objects came thru.

 

Are there any restrictions in BlazeDS serialization when using complex types as keys?

 
Replies
  • Currently Being Moderated
    Dec 21, 2011 3:55 AM   in reply to FidelGonzo

    Just in case anyone is still looking for an answer to this issue, I just ran into the same problem.  During my investigation, I learned that BlazeDS serialization is expecting only String key values for Map objects.   Since the Map coming in has Integer keys, the key is changed to a string by the serialization.  At that point, the value cannot be obtained and serialized.  Change the Integer key to a String and it works.  Here is the site that helped me get it working.

     

    http://agricola-online.blogspot.com/2010/01/hibernate-blazeds-java-5-e num-and-flex.html

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points