Compress and decompress XML in Flex and Java

橙三吉。 提交于 2019-12-14 03:58:24

问题


I want to compress XML in Flex, send it to Java, decompress it in Java and recompress it in Java, resend it to Flex, decompress it and use it. How to do please ? thnx


回答1:


Just use an AMF Gateway which is a binary format and gives much smaller transfer sizes for your data.

Look into BlazeDS and/or LiveCycle. I believe it is possible to send XML over an AMF Gateway, although most of hte time I take advantage of the built in "Backend Object to AS Object" translation,




回答2:


Just turn on gzip in your server. Then requests and responses will be automatically gzipped across the wire. In Tomcat add the compression property to the server config, like:

<Connector protocol="HTTP/1.1" port="8080" connectionTimeout="20000"
    redirectPort="8443" compression="force" maxThreads="500"
    minSpareThreads="100" maxSpareThreads="75"/>


来源:https://stackoverflow.com/questions/3353752/compress-and-decompress-xml-in-flex-and-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!