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

相關文章
相關標籤/搜索