【发布时间】:2016-10-22 05:34:11
【问题描述】:
所以问题是,自从我将资源(css、图像、js)移动到 resources/static 文件夹后,我的东西就开始工作了。
直到我创建了一个新的 .html 页面(意味着是动态的)并粘贴到 resources/templates 中。然后我所有的资源(css,图像)停止工作(找不到),我不能让它再次工作。
我用的是SpringBoot + Thymeleaf,代码可以在at GitHub找到
经过 3 小时的搜索,我无法找到解决方案,这就是我在这里的原因。谢谢,希望大家帮忙:/
编辑(一些图片):
链接:
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css'/>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css'/>
What happens (was working before, I didn't change anything in the code of listed images)
【问题讨论】:
-
我认为 /resources/static 适用于 CSS、JavaScript、图像等 Web 内容。/resources/templates 适用于 Thymeleaf 模板。两者都需要。
-
是的,我两个都有。我的问题是,在发生随机事件后,我的资源停止工作,就像页面无法再找到它一样。
-
请添加错误日志。
-
日志中没有错误。
-
随机事件 - 帮不了你。
标签: spring-mvc spring-boot thymeleaf