본문 바로가기

기타/Spring

Spring Security 를 이용하여 로그인여부 화면에 표시하기

Spring Security 3.1 에서 아래와 같은 코드를 화면에 적용하여 로그인 여부를 구분할 수 있습니다.


<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>


<sec:authorize access="isAnonymous()">

    <a href="/login" target="_self">Login</a>

</sec:authorize>

<sec:authorize access="isAuthenticated()">

    <a href="/logout" target="_self">Logout</a>

</sec:authorize>




'기타 > Spring' 카테고리의 다른 글

web.xml 에서 classpath 사용시 주의사항  (0) 2013.04.16
jxls + excel download + Spring  (3) 2012.02.20