Skip to content

Instantly share code, notes, and snippets.

@genediazjr
Last active June 19, 2020 09:53
Show Gist options
  • Save genediazjr/7983609 to your computer and use it in GitHub Desktop.
Save genediazjr/7983609 to your computer and use it in GitHub Desktop.
Add CORS Filter to Spring Maven
<!-- Append to pom.xml -->
<dependency>
<groupId>com.thetransactioncompany</groupId>
<artifactId>cors-filter</artifactId>
<version>1.8</version>
</dependency>
<!-- Append to web.xml -->
<filter>
<filter-name>CORS</filter-name>
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CORS</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
@KingIdee
Copy link

There is no web.xml file in a maven built servlet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment