spring boot 整合js css 静态文件

一,添加配置

spring:
  application:
    name: interview-server
  resources:
    static-locations: file:config/statics   //这里修改为指定的路径,它的默认路径为:classpath:[/META-INF/resources/, /resources/, /static/, /public/] 

 

二,在网页中添加引用

 

<script type="text/javascript" src="/js/login.js"></script>

 

 

三,目录结构

 

 


学习交流群:677464431,更多文章:http://www.coc88.com

 

posted @ 2018-11-09 00:38  王广帅  阅读(1572)  评论(0编辑  收藏  举报