When using @RestController like this:
@RestController public class HomeController { @RequestMapping("/") public String welcome() { return "login"; } }
This is the same as you do it in a regular controller:
@Controller public class HomeController { @RequestMapping("/") @ResponseBody public String welcome() { return "login"; } }
Using @ResponseBody returns return "login"; as a string object. Any object you return will be attached as payload in the HTTP body as JSON.
That is why you only get login in the response.
source share