WebMvcConfigurationSupport 避坑指南

您所在的位置:网站首页 webmvcconfigurationadapter WebMvcConfigurationSupport 避坑指南

WebMvcConfigurationSupport 避坑指南

2023-03-22 15:25| 来源: 网络整理| 查看: 265

@Bean public WebMvcConfigurationSupport initIndexConfig() {

return new WebMvcConfigurationSupport() { @Override protected void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/").setViewName("login"); registry.addViewController("/index.html").setViewName("login"); }

@Override protected void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/**") .addResourceLocations("classpath:/resources") .addResourceLocations("classpath:/static") .addResourceLocations("classpath:/templates") .addResourceLocations("classpath:/public"); } @Override protected void addInterceptors(InterceptorRegistry registry) { super.addInterceptors(registry); } }; }



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3