geowebcache cross-domain problem solving pro test is effective

      Deploy geowebcache in tomcat. When there is cross-domain, download the two jar packages of cors-filter-1.7.jar and java-property-utils-1.9.jar into tomcat, and open "apache-tomcat-9.0.73\ webapps\geowebcache\WEB-INF", then find the web.xml under WEB-INF and add the following configuration at the end of the filter tag

<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> 

Guess you like

Origin blog.csdn.net/weixin_43742167/article/details/130358204