文档介绍
<param-name>contextConfigLocation</param-nam<param-name>contextConfigLocation</param-nam<param-name>contextConfigLocation</param-nam<param-name>contextConfigLocation</param-namCors跨域请求,配置Access-Control-Allow-Origin"",无效解决方案由于应用需要跨域请求数据,博主在JDK8由于应用需要跨域请求数据,博主在JDK8、Tomcat7.0的cors可以配置Access-Control-Allow-Origin:"*",但是我按照文档配置以后却没有生效,一度怀疑是tomcat按照文档配置以后却没有生效,一度怀疑是tomcat或者jdk的问题,最后想起来web.xml是按照从前往后的顺序加载的。解决方案:是filter位置的问题,你把整个放到第一个filter的位置就可以了。给出web.xml:<?xmlversion="1.0"encoding="UTF-8"?><web-appid="WebApp_ID"version="2.4"xmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehtt