shiro标签使用汇总
来源:互联网 发布:全世界讨厌中国人知乎 编辑:程序博客网 时间:2024/05/17 04:32
1、介绍Shiro的标签guest标签 :验证当前用户是否为“访客”,即未认证(包含未记住)的用户。
<shiro:guest> Hi there! Please <a href="login.jsp">Login</a> or <a href="signup.jsp">Signup</a> today! </shiro:guest>
2、user标签 :认证通过或已记住的用户。
<shiro:user> Welcome back John! Not John? Click <a href="login.jsp">here<a> to login. </shiro:user>
3、authenticated标签 :已认证通过的用户。不包含已记住的用户,这是与user标签的区别所在。
<shiro:authenticated> <a href="updateAccount.jsp">Update your contact information</a>. </shiro:authenticated>
4、notAuthenticated标签 :未认证通过用户,与authenticated标签相对应。与guest标签的区别是,该标签包含已记住用户。
<shiro:notAuthenticated> Please <a href="login.jsp">login</a> in order to update your credit card information. </shiro:notAuthenticated>
5、principal 标签 :输出当前用户信息,通常为登录帐号信息。
Hello, <shiro:principal/>, how are you today?
6、hasRole标签 :验证当前用户是否属于该角色。
<shiro:hasRole name="administrator"> <a href="admin.jsp">Administer the system</a> </shiro:hasRole>
7、lacksRole标签 :与hasRole标签逻辑相反,当用户不属于该角色时验证通过。
<shiro:lacksRole name="administrator"> Sorry, you are not allowed to administer the system. </shiro:lacksRole>
8、hasAnyRole标签 :验证当前用户是否属于以下任意一个角色。
<shiro:hasAnyRoles name="developer, project manager, administrator"> You are either a developer, project manager, or administrator. </shiro:lacksRole>
9、hasPermission标签 :验证当前用户是否拥有指定权限。
<shiro:hasPermission name="user:create"> <a href="createUser.jsp">Create a new User</a> </shiro:hasPermission>
10、lacksPermission标签 :与hasPermission标签逻辑相反,当前用户没有制定权限时,验证通过。
<shiro:hasPermission name="user:create"> <a href="createUser.jsp">Create a new User</a> </shiro:hasPermission>
阅读全文
0 0
- shiro标签使用汇总
- shiro jsp标签使用
- shiro jsp标签使用
- shiro+spring使用标签
- shiro中的<shiro:principal />标签的使用
- shiro 标签使用(一)
- freemarker中使用shiro标签
- Shiro JSP标签的使用
- freemarker中使用shiro标签
- freemarker中使用shiro标签
- jstl标签使用汇总
- FreeMarker标签使用汇总
- spring mvc + shiro +thymeleaf 扩展使用shiro tags页面标签
- jsp标签中shiro的使用
- shiro的freemaker标签配置使用
- spring boot freemark 使用shiro标签
- shiro 之 Shiro 标签
- Shiro标签
- spring data jpa介绍
- 个人网盘搭建过程--资料来自腾讯云实验室
- iOS 对称加解密之AES
- Linux常用命令2
- HDFS原理剖析
- shiro标签使用汇总
- android开发之网络学习-http/https
- Best Time to Buy and Sell Stock with Transaction Fee
- 使用 GIt 关联码云远程库
- A股股票代码
- java之构造函数详解
- 窗口尺寸获取几种方式
- 程序员加薪的技巧!
- Python装饰器、metaclass、abc模块学习笔记