网上很多crossdomain.xml都不可用,现在给出我已成功测试的crossdomain版本。

  <?xml version="1.0"encoding="UTF-8"?>

  <!DOCTYPE cross-domain-policy SYSTEM  http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

  <cross-domain-policy>
        <site-control permitted-cross-domain-policies="all" />

    <allow-access-from domain="*"  to-ports="*"/>

    <allow-http-request-headers-from domain="*"headers="*"/>
  </cross-domain-policy>

 

     java代码:
     xml ="<?xml version=\"1.0\"encoding=\"UTF-8\"?>"
                +"<!DOCTYPE cross-domain-policy SYSTEM  http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">"
                +"<cross-domain-policy>"
                +"<site-control permitted-cross-domain-policies=\"all\" />"
                +"<allow-access-from domain=\"*\"  to-ports=\"*\"/> "
                +"<allow-http-request-headers-from domain=\"*\"headers=\"*\"/>"
                +"</cross-domain-policy>";