thymeleaf使用小记

记录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>

 springboot打包后 找不到html,在idea里面运行正常

 缘由是:spinrgboot没有webapp目录,在resource的几个static等文件夹里面,用thymeleaf的话 controller里面,对于模板路径的指定不能带 /

相关文章
相关标签/搜索