Upgrade to Tomcat 8.0.30 and continue to use absolute redirects

Tomcat 8.0.30 has changed to using relative URIs in its redirects
by default. To avoid any problems that this behaviour change may
causes we override the default and configure Tomcat to continue to
use absolute URIs.

Closes gh-4715
pull/4844/head
Andy Wilkinson 9 years ago
parent b10b7a883d
commit ae6971a61a

@ -134,7 +134,7 @@
<thymeleaf-extras-conditionalcomments.version>2.1.1.RELEASE</thymeleaf-extras-conditionalcomments.version> <thymeleaf-extras-conditionalcomments.version>2.1.1.RELEASE</thymeleaf-extras-conditionalcomments.version>
<thymeleaf-layout-dialect.version>1.2.9</thymeleaf-layout-dialect.version> <thymeleaf-layout-dialect.version>1.2.9</thymeleaf-layout-dialect.version>
<thymeleaf-extras-data-attribute.version>1.3</thymeleaf-extras-data-attribute.version> <thymeleaf-extras-data-attribute.version>1.3</thymeleaf-extras-data-attribute.version>
<tomcat.version>8.0.28</tomcat.version> <tomcat.version>8.0.30</tomcat.version>
<undertow.version>1.1.9.Final</undertow.version> <undertow.version>1.1.9.Final</undertow.version>
<velocity.version>1.7</velocity.version> <velocity.version>1.7</velocity.version>
<velocity-tools.version>2.0</velocity-tools.version> <velocity-tools.version>2.0</velocity-tools.version>

@ -167,6 +167,12 @@ public class TomcatEmbeddedServletContainerFactory
context.setParentClassLoader( context.setParentClassLoader(
this.resourceLoader != null ? this.resourceLoader.getClassLoader() this.resourceLoader != null ? this.resourceLoader.getClassLoader()
: ClassUtils.getDefaultClassLoader()); : ClassUtils.getDefaultClassLoader());
try {
context.setUseRelativeRedirects(false);
}
catch (NoSuchMethodError ex) {
// Tomcat is < 8.0.30. Continue
}
SkipPatternJarScanner.apply(context, this.tldSkip); SkipPatternJarScanner.apply(context, this.tldSkip);
WebappLoader loader = new WebappLoader(context.getParentClassLoader()); WebappLoader loader = new WebappLoader(context.getParentClassLoader());
loader.setLoaderClass(TomcatEmbeddedWebappClassLoader.class.getName()); loader.setLoaderClass(TomcatEmbeddedWebappClassLoader.class.getName());

Loading…
Cancel
Save