addViewControllers(): 1개의 글

[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