15.24标签支持

<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        // TODO Auto-generated method stub
        //super.doGet(req, resp);
        System.out.println(SecurityUtils.getSubject().getPrincipal());
        this.doPost(request, response);
    }
<body>
    <h1>Welcome,你懂的。</h1>
    <shiro:principal></shiro:principal>
</body>

    <shiro:hasRole name="member">
    
       <p>具备有member角色!</p>
    </shiro:hasRole>

 

    <shiro:hasAnyRoles name="member,emp">
         <p>具备有member或emp至少一种角色!</p>
    </shiro:hasAnyRoles>

    <shiro:hasAnyRoles name="member,emp">
         <p>具备有member或emp至少一种角色!</p>
    </shiro:hasAnyRoles>

    <shiro:hasPermission name="member:add">
    
        <p>具备有member:add权限</p>
    </shiro:hasPermission>

 

posted on 2018-02-08 15:16  绿茵好莱坞  阅读(122)  评论(0编辑  收藏  举报

导航