新建一個SpringBoot Web項目。而後在pom文件引入webjars的jar,pom文件代碼以下:css
<dependency> <groupId>org.webjars</groupId> <artifactId>bootstrap</artifactId> <version>3.3.5</version> </dependency> <dependency> <groupId>org.webjars</groupId> <artifactId>jquery</artifactId> <version>3.1.1</version> </dependency>
而後在src/main/resources/templates文件下新建index.html,代碼以下:html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Dalaoyang</title> <link rel="stylesheet" href="/webjars/bootstrap/3.3.5/css/bootstrap.min.css" /> <script src="/webjars/jquery/3.1.1/jquery.min.js"></script> <script src="/webjars/bootstrap/3.3.5/js/bootstrap.min.js"></script> </head> <body> <div class="container"><br/> <div class="alert alert-success"> <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> <h3>index首頁</h3>Hello, <strong>springboot and bootstrap!!!</strong> </div> </div> </body> </html>
https://www.cnblogs.com/dalao...
[https://www.cnblogs.com/dalao...][7]前端