我在开发Springboot + Thymleaf项目时,打成jar包发布到服务器后报错Template might not exist or might not be accessible…
发生这个错误的原因是,在html文件中,th:replace后路径书写错误多加了一个/,在idea中运行正常,但是打jar包后发成错误。
修改前:
<head th:replace="/admin/_fragments :: head(~{::title})">
修改后:
<head th:replace="admin/_fragments :: head(~{::title})">
作为采坑记录