Skip to main content

@CrossOrigin

Learn @CrossOrigin (CORS, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes @CrossOrigin is an annotation that enables CORS for one controller method or a whole controller class. Attributes : origins , methods , allowedHeaders , exposedHeaders , allowCredentials and maxAge . Default : with no attributes it allows all origins (patterns) and the methods mapped on the handler, so name the origins you trust.

More lessons in CORS