开发者

BlazeDS serialization with complex types

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, Lis开发者_高级运维t<String>> tempMap = new HashMap<String, List<String>>();

the objects came thru.

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


  1. Turn on property errors in your services.config.xml:

    <channels>
     <channel-definition id="YourChannel" class="mx.messaging.channels.AMFChannel">
     <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint" />
    
     <properties>
      <polling-enabled>false</polling-enabled>
      <serialization>
       <ignore-property-errors>false</ignore-property-errors>
       <log-property-errors>true</log-property-errors>
      </serialization>
     </properties>
    
     </channel-definition>
    </channels>
    
  2. Try to remove final keyword and try it without it. I had problems serializing final fields with blazeds

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜