shiro spring boot thymeleaf
生活随笔
收集整理的這篇文章主要介紹了
shiro spring boot thymeleaf
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
在整合spring boot和shiro中遇到一些問題。主要是因為用到了thymeleaf的模板。
maven應用
<dependency><groupId>com.github.theborakompanioni</groupId><artifactId>thymeleaf-extras-shiro</artifactId><version>${thymeleaf-shiro.version}</version> </dependency><dependency><groupId>com.github.theborakompanioni</groupId><artifactId>thymeleaf-extras-shiro</artifactId><version>1.2.1</version> </dependency> 在shiro的configuration中配置@Beanpublic ShiroDialect shiroDialect() {return new ShiroDialect();} 在html中加入xmlns<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> 例子<span shiro:authenticated="true" ><span>歡迎您:<span th:text="${userInfo.realName}"></span></span> </span>轉載于:https://my.oschina.net/miaojiangmin/blog/1602302
總結
以上是生活随笔為你收集整理的shiro spring boot thymeleaf的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: aar 包依赖
- 下一篇: PHP----------PHP自身的性