静态页面要么修改默认访问静态资源路径,要么将他们放在templates或static包下
如何设置静态资源映射?
@Configuration public class WebMvcConfig extends WebMvcConfigurationSupport { /** * 设置静态资源映射 * * @param registry */ @Override protected void addResourceHandlers(ResourceHandlerRegistry registry) { log.info("开始进行静态资源映射..."); registry.addResourceHandler("/backend/**").addResourceLocations("classpath:/backend/"); registry.addResourceHandler("/front/**").addResourceLocations("classpath:/front/"); } }
标签:addResourceHandler,映射,静态,registry,设置,资源 From: https://www.cnblogs.com/123sgq/p/17169114.html