header.jsp
<!-- 로그인을 하지 않은 경우 true -->
<sec:authorize access="isAnonymous()">
<a class="nav-link dropdown-toggle text-nowrap px-3"
data-toggle="dropdown" href="#" role="button" aria-haspopup="true"
aria-expanded="false"> <img
class="user-avatar rounded-circle mr-2"
src="/resources/shards/images/avatars/0.jpg" alt="User Avatar">
<span class="d-none d-md-inline-block">Sierra Brooks</span>
</a>
</sec:authorize>
<!-- 로그인 한 사용자의 경우 -->
<sec:authorize access="isAuthenticated()">
<sec:authentication property="principal.username" />님
<form method="post" action="/logout">
<button type="submit" class="mb-2 btn btn-sm btn-info mr-1">로그아웃</button>
<sec:csrfInput />
</form>
</sec:authorize>