码迷,mamicode.com
首页 > 其他好文 > 详细

thymeleaf使用小记

时间:2018-09-30 20:13:38      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:需要   version   找不到   jar包   uri   打包   1.3   显示   thymeleaf   

记录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使用小记

标签:需要   version   找不到   jar包   uri   打包   1.3   显示   thymeleaf   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!