大战熟女丰满人妻av-荡女精品导航-岛国aaaa级午夜福利片-岛国av动作片在线观看-岛国av无码免费无禁网站-岛国大片激情做爰视频

專注Java教育14年 全國(guó)咨詢/投訴熱線:400-8080-105
動(dòng)力節(jié)點(diǎn)LOGO圖
始于2009,口口相傳的Java黃埔軍校
首頁(yè) hot資訊 Shiro標(biāo)簽的用法示例

Shiro標(biāo)簽的用法示例

更新時(shí)間:2022-02-08 10:31:48 來(lái)源:動(dòng)力節(jié)點(diǎn) 瀏覽987次

Shiro 為 JSP 頁(yè)面的權(quán)限控制提供了一個(gè) JSTL 標(biāo)簽:

1.GUEST標(biāo)簽:用戶無(wú)身份驗(yàn)證信息顯示,相當(dāng)于旅游模式

<shiro:guest><br>Visitor mode, please log in: <a href="..."> login </A><br><shiro:guest>

2.用戶標(biāo)簽:用戶已經(jīng)識(shí)別登錄后顯示/記住我

<shiro:user><br>Congratulations <shiro: principal /> has been successfully logged in!<br><shiro:user>

3.Authenticated Tags:用戶已驗(yàn)證通過(guò),不記得我登陸

<shiro:authenticated>
 恭喜<shiro:principal/>驗(yàn)證
<shiro:authenticated>

4.Notauthenticated:用戶沒(méi)有認(rèn)證,沒(méi)有調(diào)用Subject.login

包括記住我登錄也屬于未認(rèn)證

<shiro:notAuthenticated>
         沒(méi)有認(rèn)證(包括“記住我” )
 </shiro:notAuthenticated>

5.principal :顯示用戶身份信息Subject.getPrincipal(),主principal,默認(rèn)為PRIMARY PRINCIPAL

<shiro:principal property= "用戶名" />

6.HASROLLE Tags: If the current Subject has a character will display content in a body

<shiro:hashRole name = " admin " > 
         user[ <shiro:principal/> ] 有一個(gè)角色 admin
 </shiro:hashRole>

7.hasanyroles Tags: If Subject has anyOneCharacter(Relationship) Will display content in the body body

<shiro:hasAnyRoles name = " admin,user " > 
         user[ <shiro:pricipal/> ] 擁有角色 admin 或 user
 </shiro:hasAnyRoles>

8.Lacksrole: If the current Subjec does not have a character, the contents of the body will be displayed.

<shiro:lacksRole name = " admin " > 
         user[ <shiro:pricipal/> ] 沒(méi)有角色 admin </br>
 </shiro:lacksRole>

9.Hashpermission: If the currentSubjectPermissionShow body content

<shiro:hashPermission name = " user:create " > 
         user[ <shiro:pricipal/> ] 擁有特權(quán)用戶:Create
 </shiro:hashPermission>

10.lackspermission: If the current Subject does not have permission, a body content will be displayed

<shiro:lacksPermission name = " org:create " > 
         user[ <shiro:pricipal/> ] 無(wú)權(quán)限 Org: CREATE
 </shiro:lacksPermission>

在 list.jsp 文件中:

<正文>
    列表。    
    歡迎:<shiro:principal></shiro:principal>    
    <shiro:hasRole name="admin"> <a href=" admin.jsp " 
    > TO Admin </a>
    </shiro:hasRole>    
   <shiro:hasRole name="user"> <a href=" user.jsp " 
    > TO User </a>
    </shiro:hasRole>    
    <a href=" shiro/logout " >注銷</a>
  </正文>

使用用戶登錄:

使用管理員登錄:

以上就是關(guān)于“Shiro標(biāo)簽的用法示例”的介紹,大家如果想了解更多相關(guān)知識(shí),不妨來(lái)關(guān)注一下動(dòng)力節(jié)點(diǎn)的Shiro視頻教程,里面的課程內(nèi)容細(xì)致全面,由淺到深,適合沒(méi)有基礎(chǔ)的小白學(xué)習(xí),希望對(duì)大家能夠有所幫助。

提交申請(qǐng)后,顧問(wèn)老師會(huì)電話與您溝通安排學(xué)習(xí)

免費(fèi)課程推薦 >>
技術(shù)文檔推薦 >>
主站蜘蛛池模板: 国产精品情侣久久婷婷文字 | 亚洲在线视频播放 | 精品一久久香蕉国产线看观看下 | 久久久久久国产视频 | 日韩精品亚洲一级在线观看 | 国产亚洲综合在线 | 人人爽天天爽夜夜爽qc | 久草在在线视频 | 久久精品国产四虎 | 四虎免费播放观看在线视频 | 久久亚洲综合伊人 | 久久免视频 | 亚洲欧美在线综合一区二区三区 | 香蕉久久夜色精品国产 | 俄罗斯美女逼 | 亚洲欧美在线看 | 久久精品国产免费看久久精品 | 97精品视频| 老司机午夜在线视频免费 | 大乳妇女bd视频在线观看 | 99久热| 另类欧美chinese | 欧美成人丝袜视频在线观看 | 成人国产精品一级毛片视频 | 日本特黄特色aaa大片免费欧 | 免费一级欧美片片线观看 | 97高清国语自产拍免费 | 久久久久99精品成人片三人毛片 | 国产精品福利在线 | 亚洲图片欧美 | 久久国产精品-久久精品 | 国产成人精品综合网站 | 特级毛片 | 精品国产欧美一区二区 | 国产精品伊人 | 97xxxx| 久久综合九色综合亚洲小说 | 大毛片a大毛片 | 亚洲视频在线网站 | 牛牛色婷婷在线视频播放 | 毛片免费网址 |