This tutorial shows how to enable CORS in Destination Application by using Annotations.
MyController.java
@CrossOrigin
Destination Application Schema [Results]
Edit Class: MyController.java
MyController.java
package com.ivoronline.springboot_cors_destination.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class MyController {
@CrossOrigin
@ResponseBody
@RequestMapping("/Hello")
public String hello() {
return "Hello from Controller";
}
}