springboot themaleaf 各类报错

1.访问themaleaf页面报错web

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Mon Jun 24 11:08:43 CST 2019 There was an unexpected error (type=Not Found, status=404). No message available

错误1:spring

调试时加入了WebMvcConfig类app

package com.feilong.Reptile.config; import org.springframework.stereotype.Component; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** * 配置静态资源映射 * * @author sunziwen * @version 1.0 * @date 2018-11-16 14:57 **/ @Component public class WebMvcConfig implements WebMvcConfigurer { /** * 添加静态资源文件,外部能够直接访问地址 * * @param registry */ @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/"); } }

删除这个类后仍是报错,猜想多是包路径问题,从新创建个新项目,将旧项目转移后,没有再报错。ide

相关文章
相关标签/搜索