ViewController 추가
2024. 6. 13. 21:21ㆍJava/Spring Boot
ViewController만 일괄로 추가할때 유용할 것 같음
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/home").setViewName("home");
registry.addViewController("/").setViewName("home");
registry.addViewController("/hello").setViewName("hello");
registry.addViewController("/login").setViewName("login");
}
}
'Java > Spring Boot' 카테고리의 다른 글
because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. (0) | 2024.07.18 |
---|---|
Spring boot에 sencha app 생성 (0) | 2024.07.13 |
@Controller와 @RestController를 같이 사용하기 (0) | 2024.05.26 |
Spring boot 3.2.5 and JDK17 셋팅 (0) | 2024.05.19 |
Spring Authorization Server 테스트 (0) | 2024.03.14 |