Update ErrorMvcAutoConfiguration for Spring 4
Update ErrorMvcAutoConfiguration thymeleaf condition to use the `spring4` package. Fixes gh-310
This commit is contained in:
parent
69f7f38403
commit
31c385470e
|
@ -115,10 +115,11 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom
|
|||
}
|
||||
|
||||
private static class ErrorTemplateMissingCondition extends SpringBootCondition {
|
||||
|
||||
@Override
|
||||
public ConditionOutcome getMatchOutcome(ConditionContext context,
|
||||
AnnotatedTypeMetadata metadata) {
|
||||
if (ClassUtils.isPresent("org.thymeleaf.spring3.SpringTemplateEngine",
|
||||
if (ClassUtils.isPresent("org.thymeleaf.spring4.SpringTemplateEngine",
|
||||
context.getClassLoader())) {
|
||||
if (DefaultTemplateResolverConfiguration.templateExists(
|
||||
context.getEnvironment(), context.getResourceLoader(), "error")) {
|
||||
|
@ -135,6 +136,7 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom
|
|||
}
|
||||
return ConditionOutcome.match("no error template view detected");
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
private static class SpelView implements View {
|
||||
|
|
Loading…
Reference in New Issue