@org.springframework.boot.autoconfigure.AutoConfiguration(after = WebMvcAutoConfiguration.class) @org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) @org.springframework.context.annotation.Import(GrailsViewResolverAutoConfiguration.RemoveDefaultViewResolverRegistrar.class) public class GrailsViewResolverAutoConfiguration extends java.lang.Object
Without the auto-injected @EnableWebMvc, Spring Boot's
WebMvcAutoConfiguration is active and contributes a defaultViewResolver
(InternalResourceViewResolver). For a Grails application that does not use
JSP/InternalResource views (e.g. a REST/JSON-views app) this catch-all resolver resolves
any unmatched view name to a servlet forward, producing
Circular view path [index]: would dispatch back to the current handler URL errors.
This is the single place the defaultViewResolver is removed for every Grails servlet
web application (GSP, JSON/Markup or plain), so Grails' own view resolution is used instead.
grails-gsp only loads for GSP applications, so the removal cannot live there. Ordered after
WebMvcAutoConfiguration so the bean exists by the time the registrar runs.
Disable with grails.web.removeDefaultViewResolverBean=false. The earlier
spring.gsp.removeDefaultViewResolverBean (when removal lived in grails-gsp) is still
honoured for backward compatibility, but is deprecated.
| 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) |