2010-10-25 64 views
1

我最近通过HashMap发送一个嵌套对象从Java到Flex的情况下,对象为空。更确切地说:复杂类型的BlazeDS序列化

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

将发送键作为整数,但值都是空的。

但具有字符串键发送时相同:

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

的对象就通。

将复杂类型用作键时,BlazeDS序列化中是否存在任何限制?

回答

1
  1. 打开属性的错误在你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. 尝试删除final关键字,并尝试没有它。我有问题序列化最后的领域与blazeds