package com.rongpan.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebConfigurer implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
//默认地址(可以是页面或后台请求接口)
registry.addViewController("/").setViewName("forward:/upload.html");
//设置过滤优先级最高
registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
}
}
如何设置SpringBoot项目默认访问页面
最新推荐文章于 2024-08-21 09:54:40 发布