Hide specific div from unauthenticated users in Thymeleaf - SoftLabio

Ads Here

Monday, September 9, 2019

Hide specific div from unauthenticated users in Thymeleaf



If you are using Spring Boot 2.1.x or latest version .Then you you can add thymeleaf-extras-springsecurity been in your POM.xml file.

This is the Maven link:
https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity5

<dependency>
    <groupId>org.thymeleaf.extras</groupId>
    <artifactId>thymeleaf-extras-springsecurity5</artifactId>
    <version>3.0.4.RELEASE</version>
</dependency>


Then update your Maven repository. If it is successful then you can use th:authenctication tag in your HTML div content.




No comments:

Post a Comment