<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!doctype html>
<html lang="ru">
<head>
...
</head>
<body>
<%--Пользователь авторизован--%>
<sec:authorize access="isAuthenticated()">
<%-- В UserDetails есть getter getDisplayName() --%>
<h3>Welcome, <sec:authentication property="principal.displayName"/></h3>
</sec:authorize>
<%--Пользователь не авторизован--%>
<sec:authorize access="isAnonymous()">
<a href="<c:url value='/auth/login'/>">Войти</a>
</sec:authorize>