Update ErrorMvcAutoConfiguration for Spring 4

Update ErrorMvcAutoConfiguration thymeleaf condition to use the
`spring4` package.

Fixes gh-310
pull/313/head
Phillip Webb 11 years ago
parent 69f7f38403
commit 31c385470e

@ -115,10 +115,11 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom
} }
private static class ErrorTemplateMissingCondition extends SpringBootCondition { private static class ErrorTemplateMissingCondition extends SpringBootCondition {
@Override @Override
public ConditionOutcome getMatchOutcome(ConditionContext context, public ConditionOutcome getMatchOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata) { AnnotatedTypeMetadata metadata) {
if (ClassUtils.isPresent("org.thymeleaf.spring3.SpringTemplateEngine", if (ClassUtils.isPresent("org.thymeleaf.spring4.SpringTemplateEngine",
context.getClassLoader())) { context.getClassLoader())) {
if (DefaultTemplateResolverConfiguration.templateExists( if (DefaultTemplateResolverConfiguration.templateExists(
context.getEnvironment(), context.getResourceLoader(), "error")) { context.getEnvironment(), context.getResourceLoader(), "error")) {
@ -135,6 +136,7 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom
} }
return ConditionOutcome.match("no error template view detected"); return ConditionOutcome.match("no error template view detected");
}; };
} }
private static class SpelView implements View { private static class SpelView implements View {

Loading…
Cancel
Save