项目需要,整理了一些Ajax跨域访问的一些文章,供需要的时候参考

1.HTML5安全:CORS(跨域资源共享)简介 http://blog.csdn.net/hfahe/article/details/7730944

2.各个服务器CORS的使用 http://enable-cors.org/

3. tomcat下CORS(跨域资源共享) 的配置    http://ibleave60.blog.51cto.com/2669415/1208652

———————————————————-

最终的解决办法,终于解决了 , tomcat 7.0.52

1. 添加/lib/ :

两个Jar包: cors-filter-1.8.jar  ,java-property-utils-1.9.jar

2.修改web.xml 添加

<filter>
    <filter-name>CORS</filter-name>
    <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
    <init-param>
     <param-name>cors.allowOrigin</param-name>
        <param-value>*</param-value>
    </init-param>
    <init-param>
     <param-name>cors.supportedMethods</param-name>
        <param-value>GET, POST, HEAD, PUT, DELETE</param-value>
    </init-param>
    <init-param>
    <param-name>cors.supportedHeaders</param-name>
    <param-value>Accept, Origin, X-Requested-With, Content-Type, Last-Modified</param-value>
</init-param>
    <init-param>
        <param-name>cors.exposedHeaders</param-name>
        <param-value>Set-Cookie</param-value>
    </init-param>
    <init-param>
        <param-name>cors.supportsCredentials</param-name>
        <param-value>true</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>CORS</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>