最近做了个springmvc的服务端,前端用ajax请求时发现 No 'Access-Control-Allow-Origin' header is present on the requested resource. 一脸懵逼。
感谢大神 : http://www.cnblogs.com/asfeixue/p/4363372.html
spring4 跨域配置:
<mvc:cors>
<mvc:mapping path="/**" allowed-origins="*" allow-credentials="true" max-age="1800" allowed-methods="GET,POST,OPTIONS"/>
</mvc:cors>