Monday 27 January 2020

Allow cross origin in leaflet (Access-Control-Allow-Origin)

Step 1.

Copy the zar file at the location-
C:\Program Files (x86)\GeoServer 2.12.1\webapps\geoserver\WEB-INF\lib


Step 2. 
Modify the web.xml file at the locaiton- 
C:\Program Files (x86)\GeoServer 2.12.1\webapps\geoserver\WEB-INF


   <!-- Uncomment following filter to enable CORS -->
   <!--<filter>
        <filter-name>cross-origin</filter-name>
        <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
    </filter>
  -->
To
   <!-- Uncomment following filter to enable CORS -->
   <!-- -->
   <filter>
        <filter-name>cross-origin</filter-name>
        <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
    </filter>




and

<!-- Uncomment following filter to enable CORS -->
    <!--<filter-mapping>
        <filter-name>cross-origin</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
     -->
To

  <!-- Uncomment following filter to enable CORS -->
    <!--  -->
  <filter-mapping>
        <filter-name>cross-origin</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping> 

Step 3. Restart the geoserver.

No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...