Need steps to configure CORES for JSAPI

839
1
10-01-2014 05:49 AM
SunilPalkar
Occasional Contributor

Hello All,

I am using ESRI suit 10.1 and ArcGIS Server installed on Amazon instance. We are consuming Map services in JSAPI and while executing map, getting CROSS domain error.

I have checked this rest service and wondering that no CORS error getting. (It might be version 10.0)

Tried following things:

1.Used following things:

esri.config.defaults.io.corsEnabledServers.push("http://myserver.com/arcgis/rest/services");

esri.config.defaults.io.corsEnabledServers.push("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services")

2.Added following things in web.xml in tomcat 8.0

<filter>

<filter-name>CorsFilter</filter-name>

<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>CorsFilter</filter-name>

<url-pattern>/*</url-pattern>

</filter-mapping>

3.Searched on Google regarding this.

Attached screen-shot so any help regarding this will be great!!

0 Kudos
1 Reply
KellyHutchins
Esri Frequent Contributor

Are you getting the cors error for your service?   In order for CORS to be successful both the browser and the server must support cors. ArcGIS Server 10.1 and later support CORS out of the box.  You can check to see if your browser supports cors here:

http://caniuse.com/#search=cors