我想实现以下流程:
我已经实现了我想要的一切,除了根据用户登录或注销显示控件。
我如何在JSP级别上执行此操作?我需要在标签中添加哪些变量?
由于
答案 0 :(得分:0)
尝试使用Spring Security taglib中的authorize tag与SpEL expressions结合使用:
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<sec:authorize access="isAuthenticated()">
Logout button goes here
</sec:authorize>
<sec:authorize access="isAnonymous()">
Login button goes here
</sec:authorize>