@org.springframework.boot.autoconfigure.AutoConfiguration(after = WebMvcAutoConfiguration.class) @org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) @org.springframework.context.annotation.Import(GrailsWelcomePageAutoConfiguration.RemoveWelcomePageMappingRegistrar.class) public class GrailsWelcomePageAutoConfiguration extends java.lang.Object
Without the auto-injected @EnableWebMvc, Spring Boot's
WebMvcAutoConfiguration is active and contributes a welcomePageHandlerMapping
(and a welcomePageNotAcceptableHandlerMapping) that maps the root path ('/') to a static
index.html found under classpath:/META-INF/resources/, classpath:/resources/,
classpath:/static/ or classpath:/public/. In a Grails application the root path is
expressed through UrlMappings, so this Boot convention overlaps with — and can shadow — the
application's own '/' mapping whenever such an index.html happens to exist.
This removes both welcome-page handler mappings for every Grails servlet web application so that
Grails' UrlMappings own the root path. Ordered after WebMvcAutoConfiguration so the
bean definitions exist by the time the registrar runs.
Disable with grails.web.removeWelcomePageMapping=false to restore Boot's welcome-page
behavior.
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |