webjars 认知

什么是webjars

WebJars是将客户端(浏览器)资源(JavaScript,Css等)打成jar包文件,以对资源进行统一依赖管理。WebJars的jar包部署在Maven中央仓库上。

添加依赖

<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.7-1</version>
</dependency>

注意

页面头部需添加外部链接
举例

<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <link rel="stylesheet" href="//www.greatytc.com/webjars/bootstrap/3.3.7-1/css/bootstrap.css">
</head>
<body>
<h2>例子</h2>
<h2>Hello Thymeleaf~</h2>
<div class="container">
    <div class="alert alert-success">
        <p th:text="${student.name}"></p>
    </div>
</div>
</body>
</html>

更多了解

https://www.webjars.org/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。