springboot --前端网页引用jar包依赖的做法

百度搜索 webjars 官网, 然后获取自己对应jar的依赖。
比如Bootstrap

<dependency>
    <groupId>org.webjars</groupId>
    <artifactId>bootstrap</artifactId>
    <version>4.4.1</version>
</dependency>

前端

<html lang="en"  xmlns:th="http://www.thymeleaf.org">

采用springboot支持的 thymeleaf 模板引擎

<html lang="en" xmlns:th="http://www.thymeleaf.org">
<link th:href="@{/webjars/bootstrap/4.4.1/css/bootstrap.css}"  rel="stylesheet">

webjars是项目目录maven文件中bootstrap的子文件夹

发布了52 篇原创文章 · 获赞 1 · 访问量 1773

猜你喜欢

转载自blog.csdn.net/qq_42039738/article/details/103914236