首页 > 其他 > 详细

thymeleaf使用小记

时间:2018-09-30 18:54:20      阅读:151      评论:0      收藏:0      [点我收藏+]

记录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里面,对于模板路径的指定不能带 /

技术分享图片

 


 

thymeleaf使用小记

原文:https://www.cnblogs.com/falcon-fei/p/9732886.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!