小编Pra*_*ngh的帖子

如何使用 Thymeleaf 在 Micronaut 中加载 css 文件?

如何使用 Thymeleaf 在 Micronaut 中加载 CSS 文件?

这是我的index.html内容:

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Demo</title>
    <link th:href="@{public/style.css}" type="text/css" rel="stylesheet" />
</head>
<body></body>
</html>
Run Code Online (Sandbox Code Playgroud)

这是application.yml

router:
  static:
    resources:
      default:
        enabled: true
        mapping: /**
        paths: 'classpath:public'
Run Code Online (Sandbox Code Playgroud)

图片说明:

资源目录结构

thymeleaf micronaut

3
推荐指数
1
解决办法
850
查看次数

标签 统计

micronaut ×1

thymeleaf ×1