Skip to content

Commit 053c5ef

Browse files
committed
Autoconfigure FreemarkerServletWebConfiguration conditional on FreemarkerViewResolver
Fixes problem where if Freemarker is present, but spring-webmvc isn't present, then Spring Boot Autoconfigure will fail with ClassNotFoundException
1 parent 48fd7a9 commit 053c5ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerServletWebConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
*/
4444
@Configuration(proxyBeanMethods = false)
4545
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
46-
@ConditionalOnClass({ Servlet.class, FreeMarkerConfigurer.class })
46+
@ConditionalOnClass({ Servlet.class, FreeMarkerConfigurer.class, FreeMarkerViewResolver.class })
4747
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
4848
class FreeMarkerServletWebConfiguration extends AbstractFreeMarkerConfiguration {
4949

0 commit comments

Comments
 (0)