Spring mvc 全局CORS滤波器给定错误

Spring mvc 全局CORS滤波器给定错误,spring-mvc,cors,Spring Mvc,Cors,我正在dispatcherservlet.xml中使用CORS过滤器 Mydispatcher servlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.

我正在dispatcherservlet.xml中使用CORS过滤器

Mydispatcher servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc.xsd">


    <context:component-scan base-package="com.mindtree" />

    <mvc:annotation-driven />

    <mvc:cors>
        <mvc:mapping path="/*"
            allowed-origins="*"
            allowed-methods="POST, GET, PUT, DELETE"
            allowed-headers="Content-Type"
            exposed-headers="header-1, header-2"
            allow-credentials="false"
            max-age="6000" />
    </mvc:cors>
</beans>

尝试将mvc:cors元素放在mvc:annotation驱动的元素之前。该元素可能重复
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:cors'.