Controller (1) 썸네일형 리스트형 Controller와 RestController의 작성 Controller와 RestController Controller MVC 패턴의 View와 Model을 이어주는 컴포넌트다. SpringMVC에서는 @Controller Annotation을 붙이고, URL에 따라 @RequestMapping 또는 method Mapping을 사용한다. @Controller public class TestApi{ @GetMapping("/msgTest") public String test(Model model){ model.addAttribute("msg","test"); return "testView"; } } class 선언 상단에 @Controller Annotation을 붙인 후 메소드에 URL Mapping을 작성한다. "/login"으로 요청이 들어오면 te.. 이전 1 다음