起个名字又长又臭$ 2020-02-06 15:50 采纳率: 0%
浏览 1988
已结题

Springboot+thymeleaf 静态资源404

图片说明

如图,我用Springboot+thymeleaf 返回了页面,但访问静态资源有问题。类型也不对。我有整合了Shiro框架

shiro过滤部分:

图片说明

资源目录:

图片说明

页面引用css:

<link href="/dist/css/style.min.css" rel="stylesheet">

用这个标签时会报错:

<link th:href="@{/static/dist/css/style.min.css}" rel="stylesheet" type="text/css"/>

No mapping for GET /auth/static/dist/css/style.min.css

yml配置:

spring:
  mvc:
    static-path-pattern: /static/**
    view:
      prefix: /templates/
      suffix: .html
  resources:
    static-locations: classpath:/static/
  thymeleaf:
    #缓冲的配置
    cache: false
    check-template: true
    check-template-location: true
    #开启MVC thymeleaf 视图解析
    enabled: true
    encoding: utf-8
    mode: HTML
    prefix: classpath:/templates/
    suffix: .html
  • 写回答

3条回答 默认 最新

  • qingdao1528 2020-02-09 12:07
    关注

    图片说明
    这个有没有配置?

    评论

报告相同问题?

悬赏问题

  • ¥15 opencv 无法读取视频
  • ¥15 用matlab 实现通信仿真
  • ¥15 按键修改电子时钟,C51单片机
  • ¥60 Java中实现如何实现张量类,并用于图像处理(不运用其他科学计算库和图像处理库))
  • ¥20 5037端口被adb自己占了
  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图