背景:抽取的模块页面放在templates目录下的子目录中,如下图,在main页面里使用相对路径无法引入commons下bar.html的模块:<div th:replace="commons/bar :: #main-header"></div>
目录结构
解决方式:以templates为根目录,使用完整的路径<div th:replace="client/commons/bar :: #main-header"></div>即可访问
背景:抽取的模块页面放在templates目录下的子目录中,如下图,在main页面里使用相对路径无法引入commons下bar.html的模块:<div th:replace="commons/bar :: #main-header"></div>
解决方式:以templates为根目录,使用完整的路径<div th:replace="client/commons/bar :: #main-header"></div>即可访问