@Configuration
public class WebMvcConfig implements WebMvcConfigurer{

    @Override
    public void addViewControllers(ViewControllerRegistry registry){
        //设置系统访问的默认首页
        registry.addViewController("/").setViewName("redirect:/app/login.html");
    }
}

备注:

(1)redirect可以改变浏览器地址;

(2)forward则不会改变浏览器地址。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
  • 2021-04-03
猜你喜欢
  • 2022-12-23
  • 2022-02-10
  • 2021-09-10
  • 2021-04-17
  • 2021-10-04
  • 2021-11-12
  • 2022-12-23
相关资源
相似解决方案