标签:option angularjs 左右 nbsp 文档 options lin 服务 app
前段时间测试angularjs,然后,用tomcat的时候,老弹出 No ‘Access-Control-Allow-Origin‘这玩意儿,然后,找了很多帖子,无果,
最后,看了tomcat的配置文档,弄了一个,问题就解决了。
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.methods</param-name>
<param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.headers</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>cors.exposed.headers</param-name>
<param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
</init-param>
<init-param>
<param-name>cors.support.credentials</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
标签:option angularjs 左右 nbsp 文档 options lin 服务 app
原文地址:http://www.cnblogs.com/hcy1994/p/6241395.html