<form method="get" th:action="@{/logout_html}" id="userinfo">
<button type="submit" class="btn btn-link">退出</button>
<b style="display:inline;" th:text="'用户名:' + ${session.loginUser}"></b>
</form>
关键代码:session.loginUser
来源:oschina
链接:https://my.oschina.net/u/4357815/blog/3432199