간단하게 로그인 소스를 보여드리면 다음과 같습니다.
로그인 처리가 끝난 후에 다음과 같이 jsp 페이지를 만들어서 테스트해보시면 될 것 같습니다.
1. JSP 페이지 상단에 추가
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
2. JSP상에서
<sec:authorize access="isAnonymous() or hasRole('ROLE_ADMIN')">
로그인전:
</sec:authorize>
<sec:authorize access="hasRole('ROLE_USER')">
로그인 후 : <sec:authentication property="principal.userRealName" />
</sec:authorize>
'programming > spring_security' 카테고리의 다른 글
생각하나 (0) | 2017.07.12 |
---|---|
ibatis 쿼리 순서 (0) | 2017.06.25 |
[Spring Security] MySQL 테이블 만들기 insert, Select하기 (0) | 2016.09.29 |
[Spring Security] 페이지 이동에 대해서 (0) | 2016.09.05 |
[Spring Security] DB에서 로그인 정보 가져오기 (5) | 2016.08.18 |