<%@ 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>