tomcat9.0配置跨域
tomcat9.0配置跨域
在web.xml添加:
<filter> <filter-name>ExpiresFilter</filter-name> <filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class> <init-param> <param-name>ExpiresDefault</param-name> <param-value>access plus 1 month</param-value> </init-param> <init-param> <param-name>ExpiresDefault</param-name> <param-value>access plus 4 weeks</param-value> </init-param> <init-param> <param-name>ExpiresDefault</param-name> <param-value>access plus 30 days</param-value> </init-param> </filter> <filter-mapping> <filter-name>ExpiresFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> </filter-mapping>
钻研不易转载请注明出处。。。。。。