Spring Framework: Summary of Reasons for Failure to Use @CrossOrigin Annotation to Solve Cross-domain Problems

solution:

After the 4.2 version of the Spring framework, Spring provides an annotation method to solve the problem.

That is, in the Controller controller, add the @CrossOrigin annotation above the Controller annotation.

However, after using this method, cross-domain problems may still occur. One of the solutions is:

The Get and Post methods are not specified in the @RequestMapping annotation. After the specific specification, the problem is solved,

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325017499&siteId=291194637