tomcat跨域问题

把clientaccesspolicy.xml和crossdomain.xml放到tomcat/webapps/Root/下面即可:
clientaccesspolicy.xml

<?xml version="1.0" encoding="utf-8" ?>  
<access-policy>  
  <cross-domain-access>  
    <policy>  
      <allow-from http-request-headers="*">  
        <domain uri="*"/>  
      </allow-from>  
      <grant-to>  
        <resource path="/" include-subpaths="true"/>  
      </grant-to>  
    </policy>  
  </cross-domain-access>  
</access-policy> 




crossdomain.xml

<?xml version="1.0"?>  
  
<cross-domain-policy>  
  
<allow-access-from domain="*" />  
  
</cross-domain-policy>  

你可能感兴趣的:(tomcat 解决跨域问题)