I\'m developing a java script client application, in server-side I need to handle CORS, all the services I had written in JAX-RS with JERSEY. My code:
@Cross
To solve this for my project I used Micheal's answer and arrived at this:
org.apache.tomcat.maven
tomcat7-maven-plugin
2.2
run-embedded
run
pre-integration-test
${maven.tomcat.port}
true
${project.basedir}/tomcat/context.xml
${maven.tomcat.web-xml.file}
The CORS filter being the basic example filter from the tomcat site.
Edit:
The maven.tomcat.web-xml.file variable is a pom defined property for the project and it contains the path to the web.xml file (located within my project)