其他分享
首页 > 其他分享> > ARCGIS SERVICE 10.2跨域问题处理

ARCGIS SERVICE 10.2跨域问题处理

作者:互联网

Arcgis Server 10.2 跨域配置

Arcgis10.3及以上版本已经默认开启跨域设置。本文只讲10.2版本的跨域配置。

 

一.下载cors-filter-1.7.jar,Java-property-utils-1.9.jar这两个库文件,放到C:\Program Files\ArcGIS\Server\framework\runtime\tomcat\lib目录下

 

 



二. 修改C:\Program Files\ArcGIS\Server\framework\runtime\tomcat\conf\web.xml 文件

在 <filter>标签平级末尾处添加以下xml代码 (490行左右)

    

 1 <filter>
 2     <filter-name>CORS</filter-name>
 3     <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
 4     <init-param>
 5     <param-name>cors.allowOrigin</param-name>
 6     <param-value>*</param-value>
 7     </init-param>
 8     <init-param>
 9     <param-name>cors.supportedMethods</param-name>
10     <param-value>GET, POST, HEAD, PUT, DELETE</param-value>
11     </init-param>
12     <init-param>
13     <param-name>cors.supportedHeaders</param-name>
14     <param-value>Accept, Origin, X-Requested-With, Content-Type, Last-Modified</param-value>
15     </init-param>
16     <init-param>
17     <param-name>cors.exposedHeaders</param-name>
18     <param-value>Set-Cookie</param-value>
19     </init-param>
20     <init-param>
21     <param-name>cors.supportsCredentials</param-name>
22     <param-value>true</param-value>
23     </init-param>
24     </filter>
25 
26     <filter-mapping>
27     <filter-name>CORS</filter-name>
28     <url-pattern>/*</url-pattern>
29     </filter-mapping>

 



重启服务
Arcgis ArcgisServer

标签:Files,10.2,跨域,SERVICE,jar,Server,cors
来源: https://www.cnblogs.com/liuyanchen/p/16360125.html