Skip to content

Deprecate Spring JSP theme support for removal in Grails 8.0.0#15457

Merged
jamesfredley merged 1 commit into7.1.xfrom
deprecate/jsp-theme-features
Feb 26, 2026
Merged

Deprecate Spring JSP theme support for removal in Grails 8.0.0#15457
jamesfredley merged 1 commit into7.1.xfrom
deprecate/jsp-theme-features

Conversation

@jamesfredley
Copy link
Contributor

Summary

  • Mark GrailsApplicationContext.onRefresh() and GrailsApplicationContext.getTheme(String) as @Deprecated(since = "7.1", forRemoval = true) with Javadoc explaining the rationale
  • Add deprecation notice to GrailsWebApplicationContext Javadoc for its ThemeSource interface implementation

Motivation

Spring's theme support (ThemeSource, Theme, UiApplicationContextUtils, SessionThemeResolver, etc.) is deprecated in Spring Framework 6 / Spring Boot 3 and removed in Spring Boot 4. Grails should surface these deprecation warnings to users now so they can migrate before Grails 8.0.0 removes the support entirely.

Changes

File Change
GrailsApplicationContext.java @Deprecated(since = "7.1", forRemoval = true) on onRefresh() and getTheme(String)
GrailsWebApplicationContext.java Javadoc deprecation note on ThemeSource implementation

Spring's theme support (ThemeSource, Theme, UiApplicationContextUtils,
SessionThemeResolver) is deprecated in Spring Framework 6 / Spring Boot 3
and removed in Spring Boot 4. Mark the Grails methods that expose this
support as @deprecated(forRemoval = true) so users receive compile-time
warnings before the removal in Grails 8.0.0.

- GrailsApplicationContext.onRefresh() - theme initialization
- GrailsApplicationContext.getTheme(String) - theme lookup
- GrailsWebApplicationContext ThemeSource implementation (Javadoc note)

Assisted-by: Claude Code <Claude@Claude.ai>
@jamesfredley jamesfredley self-assigned this Feb 25, 2026
@jamesfredley jamesfredley moved this to In Progress in Apache Grails Feb 25, 2026
@jamesfredley jamesfredley added this to the grails:7.1.0 milestone Feb 25, 2026
jamesfredley added a commit to jamesfredley/grails-core that referenced this pull request Feb 25, 2026
)

Spring's theme support (ThemeSource, Theme, ThemeResolver, etc.) was
deprecated in Spring Boot 3 / Spring Framework 6 and removed in
Spring Boot 4 / Spring Framework 7. Grails deprecated these APIs in
7.1 and now removes them entirely for 8.0.

- Delete all vendored Spring theme classes from grails-spring
- Remove ThemeSource field, onRefresh() theme init, and getTheme()
  from GrailsApplicationContext
- Remove ThemeSource from GrailsWebApplicationContext implements clause
- Remove theme setup from AbstractGrailsTagTests (both copies)
- Remove spring:theme JSP tag test (testGRAILS3797)

Assisted-by: Claude Code <Claude@Claude.ai>
@jamesfredley jamesfredley marked this pull request as ready for review February 26, 2026 00:54
@jamesfredley
Copy link
Contributor Author

Removed entirely on #15354 3fd760a

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR deprecates Spring JSP theme support in Grails to align with Spring Framework's deprecation timeline. Spring deprecated theme support in Spring Boot 3 and will remove it entirely in Spring Boot 4, so Grails is proactively marking these methods for removal in version 8.0.0 to give users time to migrate away from this functionality.

Changes:

  • Added @Deprecated annotations with since = "7.1" and forRemoval = true to theme-related methods in GrailsApplicationContext
  • Added comprehensive Javadoc explaining the deprecation rationale and timeline
  • Documented the deprecation of ThemeSource interface implementation in GrailsWebApplicationContext

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
grails-spring/src/main/groovy/org/grails/spring/GrailsApplicationContext.java Deprecated onRefresh() and getTheme(String) methods with annotations and Javadoc explaining they will be removed in Grails 8.0.0
grails-web-core/src/main/groovy/grails/web/servlet/context/GrailsWebApplicationContext.java Added Javadoc note documenting that the ThemeSource interface implementation is deprecated and will be removed in Grails 8.0.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jamesfredley jamesfredley merged commit 15bf44d into 7.1.x Feb 26, 2026
40 checks passed
@jamesfredley jamesfredley deleted the deprecate/jsp-theme-features branch February 26, 2026 01:47
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache Grails Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants