Tomcat中的字体请求跨域问题解决
生活随笔
收集整理的這篇文章主要介紹了
Tomcat中的字体请求跨域问题解决
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Tomcat中的字體請(qǐng)求跨域問(wèn)題解決
原作者地址: https://blog.csdn.net/u011974399/article/details/79990505
修改tomcat的web.xml配置文件(D:\Software\apache-tomcat-8.5.16\conf\web.xml)
在web-app標(biāo)簽下添加如下代碼
<filter><filter-name>CorsFilter</filter-name><filter-class>org.apache.catalina.filters.CorsFilter</filter-class><init-param><param-name>cors.allowed.origins</param-name><param-value>*</param-value></init-param><init-param><param-name>cors.allowed.methods</param-name><param-value>GET,POST,HEAD,OPTIONS,PUT</param-value></init-param><init-param><param-name>cors.allowed.headers</param-name><param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value></init-param><init-param><param-name>cors.exposed.headers</param-name><param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value></init-param><init-param><param-name>cors.support.credentials</param-name><param-value>true</param-value></init-param><init-param><param-name>cors.preflight.maxage</param-name><param-value>10</param-value></init-param> </filter> <filter-mapping><filter-name>CorsFilter</filter-name><url-pattern>/*</url-pattern> </filter-mapping>總結(jié)
以上是生活随笔為你收集整理的Tomcat中的字体请求跨域问题解决的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 内网环境下预览ArcGIS地图服务
- 下一篇: Nginx问题汇总