November 2017
Intermediate to advanced
542 pages
14h 24m
English
An additional, more flexible method of controlling the display of JSP content is available when the <sec> tag is used in conjunction with a SpEL expression. Let's review what we learned in Chapter 2, Getting Started with Spring Security. We could hide the My Events link from any unauthenticated users by changing our header.html file, as follows:
//src/main/resources/templates/fragments/header.html <li sec:authorize="isAuthenticated()"> <a id="navMyEventsLink" th:href="@{/events/my}">My Events</a></li>
The SpEL evaluation is performed by the same code behind the scenes as the expressions utilized in the antMatchers() method access declaration rules (assuming the expressions have been configured). Hence, the ...
Read now
Unlock full access