1. SpringBoot设置默认首页

@Configuration
public class DefaultView extends WebMvcConfigurerAdapter{

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        super.addViewControllers(registry);
        //主页
        registry.addViewController("/").setViewName("forward:/index");
    } 

}
Copyright © 試毅-思伟 2019 all right reserved,powered by 試毅-思伟修订时间: 2019-07-02 13:44:26

results matching ""

    No results matching ""