Tomcat的跨区域访问问题

Tomcat的跨区域访问问题

若允许Tomcat所有域访问,将clientaccesspolicy.xml和crossdomain.xml加入%TOMCAT_HOME%\webapps\ROOT 目录下即可

clientaccesspolicy.xml

[html]  view plain  copy
  1. <?xml version="1.0" encoding="utf-8" ?>  
  2. <access-policy>  
  3.   <cross-domain-access>  
  4.     <policy>  
  5.       <allow-from http-request-headers="*">  
  6.         <domain uri="*"/>  
  7.       </allow-from>  
  8.       <grant-to>  
  9.         <resource path="/" include-subpaths="true"/>  
  10.       </grant-to>  
  11.     </policy>  
  12.   </cross-domain-access>  
  13. </access-policy>  



crossdomain.xml
[html]  view plain  copy
  1. <?xml version="1.0"?>  
  2.   
  3. <cross-domain-policy>  
  4.   
  5. <allow-access-from domain="*" />  
  6.   
  7. </cross-domain-policy> 

你可能感兴趣的:(Tomcat的跨区域访问问题)