addViewControllers(): 1개의 글
![](http://i1.daumcdn.net/thumb/C200x150/?fname=https://blog.kakaocdn.net/dn/2ziew/btq3bGZxAXH/0WE9fFrO2bx1DDKAErHPn0/img.png)
[Spring Boot/Spring Web MVC] ViewController를 이용해서 뷰 매핑하기 @GetMapping("/hello") public String hello() { return "hello"; } 위와 같이 특정 요청 url에 대해 컨트롤러 로직 없이 바로 뷰를 리턴하는 경우 ViewController를 사용해서 뷰를 매핑할 수 있다. @Configuration public class WebConfig implements WebMvcConfigurer { @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/hello").setViewName("hell..
Spring Framework/Spring boot #3
2021. 4. 22. 03:24