地址:https://github.com/jagregory/shiro-freemarker-tags
下载该jar包 或者源代码文件复制到自己工程的lib下或者package中 

如果使用spring MVC,请看http://www.woxplife.com/articles/473.html
如果单独使用Freemarker 比如使用模板生成静态页, 在相关的类中加入如下代码:

Configuration cfg = new Configuration();
cfg.setDefaultEncoding(“UTF-8”);
cfg.setSharedVariable("shiro", new ShiroTags());

然后在ftl页面中使用tag:

<@shiro.hasRole name=”admin”>Hello admin!</@shiro.hasRole> 

freemarker中使用shiro标签的更多相关文章

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

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

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

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

  3. freemarker中使用<@spring.*>标签实现国际化

    freemarker实现国际化使用自定义指令<@spring>实现,通过@符号可以看出是自定义的指令,在哪里定义的呢? 路径如下:org/springframework/spring-we ...

  4. 8:Spring Boot中thymeleaf模板中使用 Shiro标签

    1,添加 pom.xml grade: compile('com.github.theborakompanioni:thymeleaf-extras-shiro:1.2.1') 2, Subject ...

  5. freemarker 集成 sitemesh 装饰html页面 shiro 标签

      guest标签:验证当前用户是否为"访客",即未认证(包含未记住)的用户: shiro标签:<shiro:guest></shiro:guest>  : ...

  6. freemarker使用shiro标签(spring boot)

    freemarker使用shiro标签(spring boot) 2018年07月03日 14:20:37 niu_sayok 阅读数:348更多 个人分类: freeMarkerShiro   首先 ...

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

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

  8. 细说shiro之四:在web应用中使用shiro

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

  9. Freemarker 的 Shiro 标签使用详解

    一.引入依赖(已解决版本冲突) <!-- shiro-freemarker-tags start --> <dependency> <groupId>net.min ...

随机推荐

  1. 【转】用 PHP 内置函数 file_put_contents 写入文件

    PHP 内置函数 file_put_contents 用于写入文件. file_put_contents 函数最简单的写法,可以只用两个参数,一个是文件路径,一个是要写入的内容,语法如下: file_ ...

  2. python exec

    exec官方声明This statement supports dynamic execution of Python code. exec语句用来执行储存在字符串或文件中的python语句.exec ...

  3. python之chardet库

    chardet库是python的字符编码检测器,能够检测出各种编码的类型,例如: import chardet import urllib.request testdata = urllib.requ ...

  4. elasticsearch 集群配置

    2015-10-10 09:56 by 轩脉刃, 999 阅读, 1 评论, 收藏, 编辑 elasticsearch 集群 搭建elasticsearch的集群 现在假设我们有3台es机器,想要把他 ...

  5. 纠结的NTP安装过程

    为了部署实验用的openstack环境,其中有NTP的安装环节.在这个过程中,真是折腾了一下午...遇到了一些问题! 由于公司内部网络管理的原因,很多网站没有办法访问,比如公开的时间服务站点,我找了几 ...

  6. (转载)CentOS6下 源代码方式安装openERP7.0

    CentOS6下 源代码方式安装openERP7.0 安装背景 :CPU32 bit,CentOS 6.4版本,openERP7.0,linux shell为bash,PostgreSQL9.2 1. ...

  7. windows p12(pfx)个人证书安装过程

    证书库个人证书存储区为其中的每个证书维护一个属性CERT_KEY_PROV_INFO_PROP_ID,该属性指定了证书对应的密钥容器的相关信息,包括密钥容器名,CSP名称,CSP类型,密钥用途,以及C ...

  8. Python 字典和列表的对比应用

    Q:将下列格式的txt文件,打印出该选手的3个最快跑步时间 james2.txt =>“James Lee,2002-3-14,2-34,3:21,2.34,2.45,3.01,2:01,2:0 ...

  9. SVN switch 用法详解

    一直知道SVN有个switch命令,但是对它的介绍教程却很少,大多是生硬的svn帮助文档里的文字,从而一直不怎么会用.今天看了这篇文章,突觉豁然开朗,整理下来以备查阅. 使用SVN,自然是需要与别人合 ...

  10. do break的妙用

    #include <stdio.h> #include <malloc.h> int func(int n) { //资源的统一申请 ; ; int* p = (int*)ma ...