版本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>