I am trying to get Thymeleaf to work with Spring Security in my Spring Boot 1.4.3 project.
Tags for example
<div sec:authorize="hasAuthority('ADMIN')">
just do not understand.
If I try to add SpringSecurityDialect manually as follows:
@Bean public SpringSecurityDialect securityDialect() { return new SpringSecurityDialect(); }
I get:
Exception in thread "main" java.lang.NoClassDefFoundError: org/thymeleaf/dialect/IExpressionEnhancingDialect
In my dependencies, I have included the following:
<dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity4</artifactId> </dependency>
SpringSecurityDialect does not seem to be added by autoconfiguration.
After adding the Bean manually, I get the specified exception.
Is this a mistake or am I missing something?
My versions of Thymeleaf:
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version> <thymeleaf-extras-java8time.version>3.0.0.RELEASE</thymeleaf-extras-java8time.version> <thymeleaf-layout-dialect.version>2.1.2</thymeleaf-layout-dialect.version>
source share