Fix WelcomePageHandlerMapping order

This commit fixes 220f8cd and moves the order for
`WelcomePageHandlerMapping` to `2` since the previous order was
conflicting with the resource mapping.

Closes gh-12335
pull/12459/merge
Brian Clozel 7 years ago
parent 0ce7c34036
commit a08deff0ce

@ -27,7 +27,6 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProviders;
import org.springframework.context.ApplicationContext;
import org.springframework.core.Ordered;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
@ -75,7 +74,7 @@ final class WelcomePageHandlerMapping extends AbstractUrlHandlerMapping {
ParameterizableViewController controller = new ParameterizableViewController();
controller.setViewName(viewName);
setRootHandler(controller);
setOrder(Ordered.LOWEST_PRECEDENCE - 1);
setOrder(2);
}
@Override

@ -35,7 +35,6 @@ import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
@ -70,7 +69,7 @@ public class WelcomePageHandlerMappingTests {
WelcomePageHandlerMapping handler = context
.getBean(WelcomePageHandlerMapping.class);
assertThat(handler.getOrder())
.isEqualTo(Ordered.LOWEST_PRECEDENCE - 1);
.isEqualTo(2);
});
}

Loading…
Cancel
Save