im using the full distribution on a tomcat application server 7.11.0.
In my webapp i want to load resources via jQuery/ajax from a different origin. Every time i load the resources i get the following error:
access to XMLHttpRequest at ‘https://different origin’ from origin ‘http://localhost:8080’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
How do i allow access to the resources? I already tried to configure the web.xml in the engine-rest and the server/conf folder with the propertys:
<filter> <filter-name>CorsFilter</filter-name> <filter-class>org.apache.catalina.filters.CorsFilter</filter-class> </filter> <filter-mapping> <filter-name>CorsFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
but it doesnt work. Maybe one of you knows how to do that. You would help me a lot.