• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Blocked By CORS policy error even after adding @CrossOrigin

 
Ranch Hand
Posts: 447
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my controller class.




Here is what I'm doing in Angular





No matter what I do or what I name it, it is being blocked by CORS policy.   I don't understand why.  Every other program I made, the @CrossOrigin annotation fixed it.  Why is it not working?
 
Bartender
Posts: 2265
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess you may need to add a WebMvcConfigurer bean.
Here is an example :
https://github.com/Java-Techie-jt/spring-security-cors-example/blob/master/myPortal/src/main/java/com/javatechie/spring/cors/api/MyPortalApplication.java
reply
    Bookmark Topic Watch Topic
  • New Topic