【问题标题】:BlazeDS serialization with complex types复杂类型的 BlazeDS 序列化
【发布时间】:2010-10-25 12:46:52
【问题描述】:

我最近遇到一种情况,当通过 HashMap 将嵌套对象从 Java 发送到 Flex 时,对象为空。更准确地说:

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

会将键作为整数发送,但值全部为空。

但是当使用 String 键发送相同的内容时:

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

物体通过了。

使用复杂类型作为键时,BlazeDS 序列化有什么限制吗?

【问题讨论】:

    标签: apache-flex serialization 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 序列化最终字段时遇到问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-04-03
      • 1970-01-01
      • 2015-07-21
      • 2018-04-29
      • 1970-01-01
      • 2015-10-09
      • 2010-11-03
      相关资源
      最近更新 更多