@groovy.transform.CompileStatic class Sitemesh3ViewResolverDefinitionPostProcessor extends SiteMeshViewResolverPostProcessor
Grails-flavoured SiteMeshViewResolverPostProcessor — the upstream
bean-definition wrap mode (sitemesh.viewResolver.wrapMode=bean-definition)
expressed with Grails semantics. It rewrites the jspViewResolver bean
definition into a GrailsSiteMeshViewResolver definition, so that every
instantiation of the bean — however early — yields the decorating resolver.
Wrapping at the bean-definition level (rather than post-processing the bean
instance) closes an initialization-order race: jspViewResolver is
registered lazy, so it is instantiated by whichever component first asks for
it. If that consumer is initialized before the SiteMesh
BeanPostProcessor takes effect — Spring Boot's
ContentNegotiatingViewResolver collecting every ViewResolver
while it initializes is one such consumer — it captures the raw, undecorating
resolver and keeps rendering through it, silently disabling layouts. The
rewrite itself — embedding the original definition as an anonymous inner
bean, invisible to type scans — is inherited from the upstream implementation;
this subclass adds only the Grails-specific guards.
Runs after GroovyPagesPostProcessor (which contributes the default GSP resolver definition when no plugin has registered one) so the definition being wrapped is final, whether it came from grails-gsp, the scaffolding plugin, or the application.
| Modifiers | Name | Description |
|---|---|---|
static int |
ORDER |
After GroovyPagesPostProcessor#ORDER#ORDER so the default GSP resolver
definition exists whichever module contributed it, making this the last
word on the jspViewResolver definition. |
| Constructor and description |
|---|
Sitemesh3ViewResolverDefinitionPostProcessor() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) |
After GroovyPagesPostProcessor#ORDER#ORDER so the default GSP resolver
definition exists whichever module contributed it, making this the last
word on the jspViewResolver definition.