地址: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. Oboe 提升web 用户体验以及性能

    Oboe  地址:http://oboejs.com/ 1.安装  bower bower  install oboe 2.使用,ajax 模式 oboe('/myapp/things.json') ...

  2. oracle定时运行 存储过程

    /* 查询: select job,broken,what,interval,t.* from user_jobs t; job job的唯一标识,自动生成的 broken 是否处于运行状态,N;运行 ...

  3. RMAN备份与恢复之参数文件与控制文件

    0   说明 本例是基于备份数据库全库的基础上,还原参数据文件(spfile),控制文件. 1   准备 [oracle@TEST144239 /]$ sqlplus /nolog SQL Produ ...

  4. 在VS2008环境下的C++异常处理

    在写DAServer的过程中,一直在重视报文逻辑处理,却没有认认真真地去思考异常处理的问题.曾经我发现我在所有的报文处理函数中均没有考虑报文长度的问题,让我内心不由地捏了一把冷汗.我在新增的故障录波及 ...

  5. SQL Server 2008中SQL增强之三:Merge(在一条语句中使用Insert,Update,Delete) 一条语句实现两表同步(添加、删除、修改)

    MERGE 目标表 USING 源表 ON 匹配条件 WHEN MATCHED THEN 语句 WHEN NOT MATCHED THEN 语句; http://www.chinaz.com/prog ...

  6. 【linux】grub详解

    参数解释 1. default=0 # default后加一个数字n,表示n+1个“title”操作系统,0表示第一个“title” 的操作系统,以此类推. 2. timeout=0 # timeou ...

  7. 【python】浅谈包

    python中的包可以理解为模块的集合.每个包也既可以为单包也可以有多个小包组成. Python中的package定义很简单,其层次结构与目录的层次结构相同,但是每个package必须包含一个__in ...

  8. Visual Studio Professional 2015 (x86 and x64) - DVD (Chinese-Simplified)

    文件名cn_visual_studio_professional_2015_x86_x64_dvd_6846645.isoSHA1629E7154E2695F08A3C692C0B3F6CE19DF6 ...

  9. CSS position, z-index

    position 1.fixed:定位.浮动.(需要搭配left, right) 2.absolute:相对于最近的父元素,不考虑周围的布局.(可使用z-index占据位置,则同一位置层叠) 3.re ...

  10. thinkphp在为图片添加png水印不足的处理

    thinkphp在为图片加水印的时候.如果水印图片是png图片,透明度处理很不理想,与是做以下处理 在Image.class.php中新增 static function imagecopymerge ...