From cdf785a8d129829e657967ad7b8303bd7bdc5691 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 24 Feb 2015 18:27:44 -0800 Subject: [PATCH] Fix index.html root path forwarding Fix automatic '/' -> 'index.html' forwarding to also work when a `server.servlet-path` property is set. Fixes gh-2351 --- .../boot/autoconfigure/web/WebMvcAutoConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java index b72f2e5ec0..cd12979687 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java @@ -281,7 +281,7 @@ public class WebMvcAutoConfiguration { // Ignore } // Use forward: prefix so that no view resolution is done - registry.addViewController("/").setViewName("forward:/index.html"); + registry.addViewController("/").setViewName("forward:index.html"); return; } }