1 public WebMvcConfigurer corsConfigurer() {
2 return new WebMvcConfigurer() {
3 @Override
4 public void addCorsMappings(CorsRegistry registry) {
5 registry.addMapping("/greeting-javaconfig").allowedOrigins("http://localhost:9000");
6 }
7 };
8 }Copy
1<filter>
2 <filter-name>cors</filter-name>
3 <filter-class>com.udalmik.filter.CorsFilter</filter-class>
4 </filter>
5
6 <filter-mapping>
7 <filter-name>cors</filter-name>
8 <url-pattern>/register</url-pattern>
9 </filter-mapping>
10