这里用的是 thymeleaf 2.x版本的

添加依赖

<dependency>
    <groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>
1.2.1</version>
</dependency>

在shiro的configuration中配置

@Bean
public 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>

springboot thymeleaf和shiro标签整合的更多相关文章

  1. springboot配置server相关配置&整合模板引擎Freemarker、thymeleaf&thymeleaf基本用法&thymeleaf 获取项目路径 contextPath 与取session中信息

    1.Springboot配置server相关配置(包括默认tomcat的相关配置) 下面的配置也都是模板,需要的时候在application.properties配置即可 ############## ...

  2. SpringBoot常用Starter介绍和整合模板引擎Freemaker、thymeleaf 4节课

    1.SpringBoot Starter讲解 简介:介绍什么是SpringBoot Starter和主要作用 1.官网地址:https://docs.spring.io/spring-boot/doc ...

  3. springboot与shiro在html中使用shiro标签

    上一章讲环境搭建 springboot与shiro和mybatis和mysql 现在讲html中怎么使用shiro标签,这里是基于上一章讲的 在pom文件引入依赖 <dependency> ...

  4. SpringBoot+Shiro+mybatis整合实战

    SpringBoot+Shiro+mybatis整合 1. 使用Springboot版本2.0.4 与shiro的版本 引入springboot和shiro依赖 <?xml version=&q ...

  5. SpringBoot安全管理--(三)整合shiro

    简介: Apache Shiro 是一一个开源的轻量级的Java安全框架,它提供身份验证.授权.密码管理以及会话管理等功能. 相对于Spring Security, Shiro框架更加直观.易用,同时 ...

  6. SpringBoot入门系列(五)Thymeleaf的常用标签和用法

    前面介绍了Spring Boot 中的整合Thymeleaf .不清楚的朋友可以看看之前的文章:https://www.cnblogs.com/zhangweizhong/category/16577 ...

  7. springboot shiro 基本整合

    springboot shiro 基本整合 https://www.w3cschool.cn/shiro/c52r1iff.html http://shiro.apache.org/configura ...

  8. springboot下html的js中使用shiro标签功能

    在js中直接使用shiro标签是不行的 比如 下面有个小技巧

  9. SpringBoot集成Apache Shiro

    笔者因为项目转型的原因,对Apache Shiro安全框架做了一点研究工作,故想写点东西以便将来查阅.之所以选择Shiro也是看了很多人的推荐,号称功能丰富强大,而且易于使用.实践下来的确如大多数人所 ...

随机推荐

  1. js 形参和实参---2017-04-11

    一.定义 1.实参(argument):     全称为"实际参数"是在调用时传递给函数的参数. 实参可以是常量.变量.表达式.函数等, 无论实参是何种类型的量,在进行函数调用时, ...

  2. input标签禁止输入,隐藏光标

    <INPUT class=""  value="" name= "" readonly onfocus="this.blur ...

  3. EXCEL数据导入数据库实例(NPOI)

    Default.aspx 页面代码: 引用了:    <script src="../../js/jquery.easyui.min.js" type="text/ ...

  4. 利用callKit实现电话防骚扰

    callKit框架是ios10之后更新的一个框架,代替了原来的CoreTelephony.framework,使用CallKit可以实现电话的拦截 首先创建一个项目之后,创建一个target,选择Ca ...

  5. 傻瓜式使用AutoFac

    定义一个接口: using System; using System.Collections.Generic; using System.Linq; using System.Web; namespa ...

  6. Linux-配置vim开发环境

    vim是一个类似于vi的著名的功能强大.高度可定制的文本编辑器,在vi的基础上改进和增加了很多特性.vim是纯粹的自由软件. 为了满足使用者的要求,将vim界面配置为自己想要的界面类型也变得流行起来. ...

  7. AJAX应用案例之省市联动

    jsp 主要是要注意多Document的操作 <%-- Created by IntelliJ IDEA. User: YuWenHui Date: 2017/4/23 0023 Time: 1 ...

  8. JavaWeb的国际化(17/4/8)

      国际化的缺点: 因为文字不同,所以带来的排版问题一样严重,通常都是重新在写一个网站反而更加清晰,快捷 1:需要从浏览器中获取到浏览器语言(Accept-Language) 2:利用locale获取 ...

  9. Git操作指南

    请访问以下网址,很详细,今天偷个懒记录一下,之后有时间再来补全吧! https://git-scm.com/book/zh/v2

  10. 【运维工程师必知必会】——MySql基础

    一.SQL语句 1.分类 DDL(data definition language)数据定义语言(create.alter.drop),管理基础数据.例如:库.表     #运维要熟练,开发也要熟练 ...