Skip to content

Commit 1247050

Browse files
committed
Tolerate context root redirect not being configurable on Tomcat 7
Closes gh-13821
1 parent 7a000e6 commit 1247050

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,12 @@ private void customizeRedirectContextRoot(
10491049

10501050
@Override
10511051
public void customize(Context context) {
1052-
context.setMapperContextRootRedirectEnabled(redirectContextRoot);
1052+
try {
1053+
context.setMapperContextRootRedirectEnabled(redirectContextRoot);
1054+
}
1055+
catch (NoSuchMethodError ex) {
1056+
// Tomcat 7. Continue.
1057+
}
10531058
}
10541059

10551060
});

0 commit comments

Comments
 (0)