spring 解决跨域

版本spring4.2 , 配置文件上加入以下代码

<!-- 解决跨域问题-->
     <mvc:cors>
        <mvc:mapping path="/**"
                     allowed-origins="*"
                     allowed-methods="GET,POST,PUT,DELETE,OPTIONS"
                     allowed-headers="header1, header2, header3"
                     exposed-headers="header1, header2"
                     allow-credentials="false"
                     max-age="3600" />
     </mvc:cors>

猜你喜欢

转载自blog.csdn.net/u012040869/article/details/78664693