增加此配置后,就不需要在controller中手动写路径到视图的映射了
/**
* @author houChen
* @date 2021/12/18 15:51
* @Description:
*
* 访问路径和视图的映射
* 添加了此配置类,就不需要写controller到视图的跳转
*
*/
@Configuration
public class GulimallWebConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("index.html").setViewName("index");
registry.addViewController("reg.html").setViewName("reg");
}
}