Tutorial by Examples

This example is a very simple Spring Boot application. Maven Dependencies At first add the following dependencies to your project. Spring Initializr is recommended when you create a new project. <parent> <groupId>org.springframework.boot</groupId> <artifactId>spr...
<div sec:authorize="isAuthenticated()"> This text is displayed for authenticated users. </div>
You can show username for autenticated users <div sec:authorize="isAuthenticated()"> Welcome, <span sec:authentication="name">Username</span> </div>
The sec:authorize attribute renders its content when the attribute expression is evaluated to true <div sec:authorize="hasRole('ROLE_ADMIN')"> Content for administrators </div> <div sec:authorize="hasRole('ROLE_USER')"> Content for users </div&g...

Page 1 of 1