spring 解决跨域

来源:互联网 发布:ac尼尔森数据 方便面 编辑:程序博客网 时间:2024/05/21 08:07

版本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>
原创粉丝点击