codeconsole opened a new pull request, #15966: URL: https://github.com/apache/grails-core/pull/15966
### Summary Migrates `ScaffoldingGrailsPlugin` off the deprecated `doWithSpring()` bean DSL (deprecated by #15934) and makes the descriptor fully `@CompileStatic` — the second in-tree plugin on the modern registration API, following the SiteMesh 3 module in #15964. The two PRs are independent; both preserve the same view-resolver pipeline. ### Why not a straight `beanRegistrar()` port The old DSL definition relied on `bean.parent = 'abstractViewResolver'`, and parent/abstract bean templates are one of the DSL constructs `BeanRegistry` deliberately has no equivalent for (per #15934). Re-declaring the GSP resolver defaults inside scaffolding would duplicate them and drift. Instead, `beanRegistrar()` registers a small `ScaffoldingViewResolverDefinitionPostProcessor` that contributes the `jspViewResolver` **definition** — same class, same `abstractViewResolver` parent, same `lazyInit` — at order **-2**, which slots into the established post-processor pipeline exactly where the DSL registration used to sit: | order | post-processor | behaviour | |---|---|---| | -2 | `ScaffoldingViewResolverDefinitionPostProcessor` (this PR) | contributes the scaffolding resolver definition unless one exists | | -1 | `GrailsLayoutViewResolverPostProcessor` (grails-layout / SiteMesh 2) | embeds the existing definition as its inner view resolver | | 0 | `GroovyPagesPostProcessor` (grails-gsp) | contributes the plain GSP resolver only when no definition exists | | +10 | `Sitemesh3ViewResolverDefinitionPostProcessor` (#15964) | wraps the definition for SiteMesh 3 decoration | Behavioural parity notes: - An existing `jspViewResolver` definition (application `resources.groovy`, another plugin) still wins, matching the old override semantics. - `grails.scaffolding.enableNamespaceViewDefaults` is now read from the Spring `Environment` rather than the Grails config object — equivalent since the config is built from the environment. - The reload-enabled computation (`Environment.current` / development-mode metadata) is unchanged, just relocated. ### Testing - New `ScaffoldingViewResolverDefinitionPostProcessorSpec` covering registration (parent template, lazy-init, property values), the environment-driven `enableNamespaceViewDefaults`, existing-definition precedence, and the pipeline ordering contract. - `:grails-scaffolding:test` passes. - Verified end-to-end on a real application with this module and the #15964 module swapped in together (the eventual merged state): scaffolded controller pages and `(view:)` URL mappings both render with layouts applied through the SiteMesh 3 view-resolver chain, and the resolver arrives wrapped as `GrailsSiteMeshViewResolver[inner=ScaffoldingViewResolver]`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
