in my project having different admin role, on click of button link want to check his role and show the page as per his role, how can do this in jsp file? can write function onclick
答案 0 :(得分:0)
您可以通过有条件地显示链接来实现。这是基于用户角色的显示/隐藏链接。 Spring安全性标记库将为您提供帮助。 例如:
<sec:authorize access="hasRole('ROLE_ADMIN')">
<td><a href="<c:url value="/page1.htm"/>">Admin Access Page</a></td>
</sec:authorize>
有关详情,请查看this.