默認配置
Spring Boot默認提供靜態資源目錄位置需置於classpath下,目錄名需符合如下規則:
- /static
- /public
- /resources
- /META-INF/resources
http://blog.didispace.com/springbootweb/
Spring Boot Thymeleaf有默認歡迎面路徑: src/main/resources/static/index.html
相關說明
https://spring.io/guides/gs/serving-web-content/#initial
https://github.com/spring-projects/spring-boot/issues/7938
在application.properties文件中增加Thymeleaf模板的配置
spring.thymeleaf.cache=false
說明一下,這些配置不是必須的,如果配置了會覆蓋默認的。
在開發時建議將spring.thymeleaf.cache設置爲false,否則會有緩存,導致頁面沒法及時看到更新後的效果。
比如你修改了一個文件,已經update到tomcat,但刷新頁面還是之前的頁面,就是因爲緩存引起的。
https://blog.csdn.net/qincidong/article/details/76126060
html 頁面裏要寫 <html xmlns:th="http://www.thymeleaf.org">
引用css js 格式
<link th:href="@{/home/bootstrap.min.css}" rel="stylesheet"/>
<script th:src="@{/home/bootstrap.min.js}"></script>
頁面報錯
HTTP Status 500 - Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Exception parsing document: template="home/el", line 18 - column 7
html頁面上的標籤必須閉合
https://blog.csdn.net/qq_35056292/article/details/79087993
https://www.cnblogs.com/memoryXudy/p/7681991.html
在 HTML 中使用 REACT 和 JSX —— 不使用 NODEJS
https://techctu.github.io/2017/02/18/%E5%9C%A8-html-%E4%B8%AD%E4%BD%BF%E7%94%A8-react-%E5%92%8C-jsx-%E4%B8%8D%E4%BD%BF%E7%94%A8-nodejs.html
Spring Boot乾貨系列總綱
http://tengj.top/2017/04/24/springboot0/