zoukankan      html  css  js  c++  java
  • springboot 1.5.2 thymeleaf 添加templates 静态资源访问路径

    从velocity 模板切换到thymeleaf 后, 默认模板位置为templates , 有时候静态资源方在该目录下会出现访问404错误

    解决办法:

    application.properties 中添加:

    #dev tools
    spring.devtools.livereload.enabled=true
    # 静态文件请求匹配方式
    spring.mvc.static-path-pattern=/**
    # 修改默认的静态寻址资源目录
    spring.resources.static-locations = classpath:/templates/,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/
  • 相关阅读:
    背包问题
    阶乘尾数0的个数
    欧拉筛找素数
    威佐夫博弈
    三角形面积
    deleted
    deleted
    deleted
    deleted
    deleted
  • 原文地址:https://www.cnblogs.com/xiaojf/p/6607922.html
Copyright © 2011-2022 走看看