上一章讲环境搭建

springboot与shiro和mybatis和mysql

现在讲html中怎么使用shiro标签,这里是基于上一章讲的

在pom文件引入依赖

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

shiro的配置类ShiroConfig.java添加bean【at.pollux.thymeleaf.shiro.dialect.ShiroDialect】

 @Bean
public ShiroDialect shiroDialect() {
return new ShiroDialect();
}

 <!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head>
<title>首页</title>
</head>
<body>
<h1>首页</h1>
<hr>
<ul>
<li><a href="user/index">个人中心</a></li>
<li><a href="vip/index">会员中心</a></li>
<p shiro:hasPermission="svip"><li>这是svip能看到的p标签</li></p>
<shiro:hasPermission name="svip"><li>这是svip能看到的</li></shiro:hasPermission>
<li><a href="logout">退出登录</a></li>
</ul>
</body>
</html>

接着上一章的测试

参考文章:https://blog.csdn.net/fox9916/article/details/80221894

springboot与shiro在html中使用shiro标签的更多相关文章

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

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

  2. SpringBoot系列: SpringBoot Web项目中使用Shiro

    注意点有:1. 不要启用 spring-boot-devtools, 如果启用 devtools 后, 不管是热启动还是手工重启, devtools总是试图重新恢复之前的session数据, 很有可能 ...

  3. 在前后端分离的SpringBoot项目中集成Shiro权限框架

    参考[1].在前后端分离的SpringBoot项目中集成Shiro权限框架 参考[2]. Springboot + Vue + shiro 实现前后端分离.权限控制   以及跨域的问题也有涉及

  4. SpringBoot系列: SpringBoot Web项目中使用Shiro 之二

    ==================================Shiro 的加深理解:==================================1. Shiro 和 Spring 系组 ...

  5. SpringBoot中关于Shiro权限管理的整合使用

     转载:https://blog.csdn.net/fuweilian1/article/details/80309192 在整合Shiro的时候,我们先要确定一下我们的步骤: 1.加入Shiro的依 ...

  6. springboot项目中使用shiro实现用户登录以及权限的验证

    欢迎大家加入我的社区:http://t.csdn.cn/Q52km 社区中不定时发红包 更加高级的验证用户权限:用户表.角色表.权限表.多表联合:https://blog.csdn.net/weixi ...

  7. springboot+mybatis+shiro项目中使用shiro实现登录用户的权限验证。权限表、角色表、用户表。从不同的表中收集用户的权限、

    要实现的目的:根据登录用户.查询出当前用户具有的所有权限.然后登录系统后.根据查询到的权限信息进行不同的操作. 以下的代码是在搭好的框架之下进行的编码. 文章目录 核心实现部分. 第一种是将用户表和角 ...

  8. [原]CAS和Shiro在spring中集成

    shiro是权限管理框架,现在已经会利用它如何控制权限.为了能够为多个系统提供统一认证入口,又研究了单点登录框架cas.因为二者都会涉及到对session的管理,所以需要进行集成. Shiro在1.2 ...

  9. 细说shiro之五:在spring框架中集成shiro

    官网:https://shiro.apache.org/ 1. 下载在Maven项目中的依赖配置如下: <!-- shiro配置 --> <dependency> <gr ...

随机推荐

  1. jmeter+ant执行 报错:Reference xslt.classpath not found 【采坑记录】

    问题: report: BUILD FAILED E:\jmeter\apache-jmeter-4.0\testcase\build.xml:29: The following error occu ...

  2. 开启php的PDO扩展,mysql扩展

    打开php.ini配置文件,找到extension=php_pdo.dll 和 extension=php_pdo_mysql.dll ,去掉前面“;”的注释,修改后的两行配置内容如下: extens ...

  3. ubuntu16.04安装matlab_R2018a/R2017a

    ubuntu16.04安装matlab_R2018a/R2017a 1. 文件准备 我把Matlab2018a安装镜像及破解文件放在了/home/haes/Downloads/matlab下 2.挂载 ...

  4. STL算法之find

    定义 template <class InputIterator, class T> InputIterator find (InputIterator first, InputItera ...

  5. vue 弹窗式 滑动图片验证码

    效果图: 具体代码: test.vue //整个页面是个弹窗 visible 控制弹窗的显示关闭 默认打开 <template> <div class="mask_laye ...

  6. 快速安装python3

    使用 rpm 包进行安装 先来介绍一下 IUS 这个社区,名字的全写是[Inline with Upstream Stable]取首字母,它主要是一个提供新版本RPM包的社区.具体使用可以查看官方文档 ...

  7. vue-cli的eslint不加空格报错问题

    //方法一.直接不启用eslint(不推荐) //找到build/webpack.base.conf.js把以下代码取消注释 { test: /\.(js|vue)$/, loader: 'eslin ...

  8. C# 读取文件内容

    读取文件内容有三种方式 全部读取到字符串变量中 一次读取一行 全部读取到字符串数组中,每个数组元素存储一行文本 全部读取到字符串变量 string text = System.IO.File.Read ...

  9. i18n 语言码和对应的语言库

    语言码 语言名称 af Afrikaans am Amharic ar Arabic az Azerbaijani be Belarusian bg Bulgarian bh Bihari bn Be ...

  10. osg 加载 fbx文件

    #ifdef _WIN32 #include <Windows.h> #endif // _WIN32 #include <osg/Group> #include <os ...