diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 6214e4f863..4046766b0e 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -1049,7 +1049,12 @@ public class ServerProperties @Override public void customize(Context context) { - context.setMapperContextRootRedirectEnabled(redirectContextRoot); + try { + context.setMapperContextRootRedirectEnabled(redirectContextRoot); + } + catch (NoSuchMethodError ex) { + // Tomcat 7. Continue. + } } });