This is an automated email from the ASF dual-hosted git repository.

jamesfredley pushed a commit to branch deprecate/jsp-theme-features
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit 7ac3109e0e20495f7e691006f2043c93a76e3598
Author: James Fredley <[email protected]>
AuthorDate: Wed Feb 25 17:57:28 2026 -0500

    deprecate: mark Spring JSP theme support for removal in Grails 8.0.0
    
    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 <[email protected]>
---
 .../groovy/org/grails/spring/GrailsApplicationContext.java  | 13 +++++++++++++
 .../web/servlet/context/GrailsWebApplicationContext.java    |  4 ++++
 2 files changed, 17 insertions(+)

diff --git 
a/grails-spring/src/main/groovy/org/grails/spring/GrailsApplicationContext.java 
b/grails-spring/src/main/groovy/org/grails/spring/GrailsApplicationContext.java
index e0e85ad219..40bbe2daa8 100644
--- 
a/grails-spring/src/main/groovy/org/grails/spring/GrailsApplicationContext.java
+++ 
b/grails-spring/src/main/groovy/org/grails/spring/GrailsApplicationContext.java
@@ -98,12 +98,25 @@ public class GrailsApplicationContext extends 
GenericApplicationContext implemen
 
     /**
      * Initialize the theme capability.
+     *
+     * @deprecated since 7.1, for removal in 8.0. Spring's theme support 
({@link ThemeSource},
+     * {@link UiApplicationContextUtils#initThemeSource}) is deprecated in 
Spring Boot 3 and
+     * removed in Spring Boot 4. This method will be removed in Grails 8.0.0.
      */
+    @Deprecated(since = "7.1", forRemoval = true)
     @Override
     protected void onRefresh() {
         themeSource = UiApplicationContextUtils.initThemeSource(this);
     }
 
+    /**
+     * Return the {@link Theme} instance for the given theme name.
+     *
+     * @deprecated since 7.1, for removal in 8.0. Spring's theme support 
({@link ThemeSource},
+     * {@link Theme}) is deprecated in Spring Boot 3 and removed in Spring 
Boot 4.
+     * This method will be removed in Grails 8.0.0.
+     */
+    @Deprecated(since = "7.1", forRemoval = true)
     public Theme getTheme(String themeName) {
         return themeSource.getTheme(themeName);
     }
diff --git 
a/grails-web-core/src/main/groovy/grails/web/servlet/context/GrailsWebApplicationContext.java
 
b/grails-web-core/src/main/groovy/grails/web/servlet/context/GrailsWebApplicationContext.java
index 46fe8cbb13..fa91e4b9ea 100644
--- 
a/grails-web-core/src/main/groovy/grails/web/servlet/context/GrailsWebApplicationContext.java
+++ 
b/grails-web-core/src/main/groovy/grails/web/servlet/context/GrailsWebApplicationContext.java
@@ -48,6 +48,10 @@ import org.grails.spring.GrailsApplicationContext;
  * A WebApplicationContext that extends StaticApplicationContext to allow for 
programmatic
  * configuration at runtime. The code is adapted from 
StaticWebApplicationContext.
  *
+ * <p>Note: The {@link ThemeSource} interface implementation is deprecated 
since Grails 7.1 and
+ * will be removed in Grails 8.0.0. Spring's theme support is deprecated in 
Spring Boot 3 and
+ * removed in Spring Boot 4.
+ *
  * @author Graeme
  * @since 0.3
  */

Reply via email to