css - Spring Boot - 不能包含静态资源

标签 css spring spring-boot kotlin

目录结构

enter image description here

我尝试在 profile.html 中包含 css

<link th:href="@{css/profile.css}" rel="stylesheet" />

但这行不通

我的应用类

@SpringBootApplication
class Application

fun main(args: Array<String>) {
    SpringApplication.run(Application::class.java, *args)
}

附言对不起我的英语

最佳答案

如果您尝试从带有 jsp 页面的静态内容开始,这是一个很好的例子。

希望对你有帮助

spring-boot-hello-world-example-jsp

关于css - Spring Boot - 不能包含静态资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47239426/

相关文章:

java - 错误: Field dataSource in required a bean of type 'javax.activation.DataSource' that could not be found

html - 将父 div 设置为 flex 但不让子组件这样呈现

java - Spring Boot中redis CacheManager反序列化时的错误处理

css - 将 ngAnimate 与 ng-show/ng-hide 结合使用

spring - Spring Tools Suite中的Groovy版本冲突

spring - 在每个 Spring 启动 @Test 上覆盖单个 @Configuration 类

json - RestTemplate PATCH 请求

tomcat - 使用嵌入式 Tomcat 7 在 Spring Boot 中启用 SSL - FileNotFoundException 和 o.a.coyote.http11.Http11NioProtocol 问题

css - 固定导航栏中的固定元素

使网页变暗时的 JQuery DIV 弹出窗口