Should the cors be enabled for tomcat in eclipse or web.xml
I enabled jar plugins and set them with web.xml but doesnt work
Should the cors be enabled for tomcat in eclipse or web.xml
I enabled jar plugins and set them with web.xml but doesnt work
Here's a working config :
<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, PUT, OPTIONS</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.headers</param-name>
<!-- add the headers here, that you want to read from REQUEST-->
<param-value>Origin,Accept,X-Requested-With,Content-Type,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>
</init-param>
<init-param>
<param-name>cors.exposed.headers</param-name>
<!-- add the headers here, that you want to WRITE in the response-->
<param-value></param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>