起个名字又长又臭$ 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 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题