@groovy.transform.CompileStatic @groovy.util.logging.Slf4j class Sitemesh3EnvironmentPostProcessor extends java.lang.Object implements EnvironmentPostProcessor, Ordered
Contributes the Grails defaults for the SiteMesh 3 configuration keys —
layout selection via the layout meta tag, the
/layouts/ decorator prefix and, when configured, the application's
default layout — before the application context refreshes.
Because these defaults are in the ConfigurableEnvironment from the
start, both the SiteMesh starter's @Value placeholders and the Grails
configuration (which is built from the environment) observe them without any
post-hoc reassignment. This replaces the property-source manipulation the
plugin previously performed in doWithSpring().
Each default is contributed only when the application has not set the key itself, and the source is appended with lowest precedence, so application configuration always wins.
| Type | Name and description |
|---|---|
static java.lang.String |
PROPERTY_SOURCE_NAME |
static java.lang.String |
SITEMESH2_MARKER_CLASSA class unique to the SiteMesh 2 module (grails-layout). grails-sitemesh3 is a drop-in replacement for it — the two modules are mutually exclusive by contract. |
| Constructor and description |
|---|
Sitemesh3EnvironmentPostProcessor() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static MapPropertySource |
getDefaultPropertySource(ConfigurableEnvironment environment)The SiteMesh 3 defaults not already configured in the given environment. |
|
int |
getOrder() |
|
static boolean |
isSiteMesh2Present()Whether the SiteMesh 2 module (grails-layout) shares the classpath. |
|
void |
postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) |
| 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) |
A class unique to the SiteMesh 2 module (grails-layout). grails-sitemesh3
is a drop-in replacement for it — the two modules are mutually exclusive
by contract. Because grails-sitemesh3 arrives transitively through
grails-dependencies-starter-web, an application that declares
grails-layout can end up with both on the classpath; that state is
currently tolerated for migration compatibility — the SiteMesh 2
integration keeps decorating and this module's view-resolver machinery
stands down — but it is warned about loudly and support for it may be
removed.
The SiteMesh 3 defaults not already configured in the given environment.
Public because grails.gsp.boot.GspAutoConfiguration applies the
same defaults for plain Spring Boot GSP applications whose contexts are
built without SpringApplication (where no
EnvironmentPostProcessor runs).
Whether the SiteMesh 2 module (grails-layout) shares the classpath. When it does, this module's view-resolver decoration stands down entirely.