concept @crossorigin annotation in category spring

appears as: @CrossOrigin notation
Spring Security in Action

This is an excerpt from Manning's book Spring Security in Action.

10.2.2    Applying CORS policies with the @CrossOrigin annotation

In this section, we’ll discuss how to configure CORS to allow requests from different domains, which we allow using the @CrossOrigin annotation. You can place the @CrossOrigin annotation directly above the method which defines the endpoint and configure using it the allowed origins and methods. As you’ll learn in this section, the advantage of using the @CrossOrigin annotation is that it makes it very easy to configure CORS per each endpoint. We’ll use the application we’ve created in section 10.2.1 to demonstrate how @CrossOrigin annotation works.