From dbdafe668c52697dbc279ac4d686132b0f9df1dc Mon Sep 17 00:00:00 2001 From: gichanGim Date: Sun, 28 Jun 2026 15:46:51 +0900 Subject: [PATCH 1/2] Make ResourceHandlerRegistrationCustomizer public See gh-50792 Signed-off-by: gichanGim --- ...ResourceHandlerRegistrationCustomizer.java | 36 +++++++++++++++++++ .../WebMvcAutoConfiguration.java | 7 ---- 2 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/ResourceHandlerRegistrationCustomizer.java diff --git a/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/ResourceHandlerRegistrationCustomizer.java b/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/ResourceHandlerRegistrationCustomizer.java new file mode 100644 index 000000000000..7b4932f78b13 --- /dev/null +++ b/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/ResourceHandlerRegistrationCustomizer.java @@ -0,0 +1,36 @@ +/* + * Copyright 2012-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.webmvc.autoconfigure; + +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration; + +/** + * Callback interface that can be used to customize {@link ResourceHandlerRegistration}. + * + * @author Brian Clozel + * @since 4.1.1 + */ +@FunctionalInterface +public interface ResourceHandlerRegistrationCustomizer { + + /** + * Customize the given {@link ResourceHandlerRegistration}. + * @param registration the registration to customize + */ + void customize(ResourceHandlerRegistration registration); + +} diff --git a/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfiguration.java b/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfiguration.java index 7d829e17d76d..281b124124a0 100644 --- a/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfiguration.java +++ b/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfiguration.java @@ -676,13 +676,6 @@ T create(TemplateAvailabilityProviders templateAvailabilityProviders, Applicatio } - @FunctionalInterface - interface ResourceHandlerRegistrationCustomizer { - - void customize(ResourceHandlerRegistration registration); - - } - static class ResourceChainResourceHandlerRegistrationCustomizer implements ResourceHandlerRegistrationCustomizer { private final Resources resourceProperties; From e03e1ed798cb67899f1d358ebd58e1af192a1f77 Mon Sep 17 00:00:00 2001 From: gichanGim Date: Sun, 28 Jun 2026 21:10:58 +0900 Subject: [PATCH 2/2] Update @since to 4.2.0 Signed-off-by: gichanGim --- .../autoconfigure/ResourceHandlerRegistrationCustomizer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/ResourceHandlerRegistrationCustomizer.java b/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/ResourceHandlerRegistrationCustomizer.java index 7b4932f78b13..ec0c7bca6d94 100644 --- a/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/ResourceHandlerRegistrationCustomizer.java +++ b/module/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/ResourceHandlerRegistrationCustomizer.java @@ -22,7 +22,7 @@ * Callback interface that can be used to customize {@link ResourceHandlerRegistration}. * * @author Brian Clozel - * @since 4.1.1 + * @since 4.2.0 */ @FunctionalInterface public interface ResourceHandlerRegistrationCustomizer {