記錄thymeleaf使用種遇到的一些問題,備忘。html
使用thymeleaf+springsecurity,想要顯示當前登錄用戶,有專門的標籤。使用順序以下java
一、 引入jar包 (須要注意的是要同thymeleaf版本相對應 )
二、 maven座標以下
<dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity4</artifactId> <version>2.1.3.RELEASE</version> </dependency>
緣由是:spinrgboot沒有webapp目錄,在resource的幾個static等文件夾裏面,用thymeleaf的話 controller裏面,對於模板路徑的指定不能帶 /