SpringBoot学习笔记

一.使用WebMvcConfigurer接口来扩展SpringMVC的功能

@Configuration
public class MyMvcConfig implements WebMvcConfigurer{

}

1添加试图映射

@Configuration
public class MyMvcConfig implements WebMvcConfigurer{
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //浏览器mvctest请求去找success文件
        registry.addViewController("/mvctest").setViewName("success");
    }
}
原文地址:https://www.cnblogs.com/xiaolan-/p/12209210.html