记录thymeleaf使用种遇到的一些问题,备忘。

 

前台页面显示当前登陆用户

使用thymeleaf+springsecurity,想要显示当前登陆用户,有专门的标签。使用顺序如下

1、  引入jar包 (需要注意的是要同thymeleaf版本相对应 )
2、  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里面,对于模板路径的指定不能带 /

 


 
posted on 2018-09-30 17:49  falcon_fei  阅读(134)  评论(0编辑  收藏  举报