Skip to content

Commit 06017f6

Browse files
committed
Only auto-configure SpringSocialDialect for Thymeleaf 2
Previously, SocialWebAutoConfiguration would create a SpringSocialDialect bean when SpringTemplateEngine was on the classpath. This class exists in both Thymeleaf 2 and Thymeleaf 3 but SpringSocialDialect is only compatible with Thymeleaf 2. This commit updates the auto-configuration to require SpringResourceResourceResolver to be on the classpath. This class exists in Thymeleaf 2 but does not exist in Thymeleaf 3. Closes gh-4858
1 parent 570b059 commit 06017f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialWebAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
1818

1919
import java.util.List;
2020

21-
import org.thymeleaf.spring4.SpringTemplateEngine;
21+
import org.thymeleaf.spring4.resourceresolver.SpringResourceResourceResolver;
2222

2323
import org.springframework.beans.factory.ObjectProvider;
2424
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
@@ -164,7 +164,7 @@ public UserIdSource getUserIdSource() {
164164
}
165165

166166
@Configuration
167-
@ConditionalOnClass(SpringTemplateEngine.class)
167+
@ConditionalOnClass(SpringResourceResourceResolver.class)
168168
protected static class SpringSocialThymeleafConfig {
169169

170170
@Bean

0 commit comments

Comments
 (0)