Shiro在集成Spring的Jsp標籤權限控制配置增強(十六)

步驟:

1:顯示當前登錄用戶名稱

    1)main.jsp引入shiro的標籤庫

    2)添加顯示用戶名的標籤

//單純顯示user的hashcode地址
<shiro:principal></shiro:principal>
//顯示user類的username屬性
<shiro:principal property="username"></shiro:principal>

//權限控制
<shiro:hasPermission name="employee:list"></shiro:hasPermission>

2:實現用戶註銷

       在spring-shiro.xml文件中多添加一個註銷的攔截器(logout攔截器)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章