Tolerate context root redirect not being configurable on Tomcat 7

Closes gh-13821
This commit is contained in:
Andy Wilkinson 2018-09-07 14:04:23 +01:00
parent 7a000e68cd
commit 124705080b
1 changed files with 6 additions and 1 deletions

View File

@ -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.
}
}
});