From e8d6484597857cf9fed704a25888b7007065fd56 Mon Sep 17 00:00:00 2001 From: king-407 <95581750+king-407@users.noreply.github.com> Date: Mon, 8 Jun 2026 02:46:33 +0530 Subject: [PATCH] Document WebFlux RequestContext locale change scope Signed-off-by: king-407 <95581750+king-407@users.noreply.github.com> --- .../web/reactive/result/view/RequestContext.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RequestContext.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RequestContext.java index 624fd0ce493a..e6a4275090e9 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RequestContext.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RequestContext.java @@ -134,6 +134,12 @@ public TimeZone getTimeZone() { /** * Change the current locale to the specified one. + *

This change is scoped to this {@code RequestContext} instance for the + * current rendering operation and does not update the + * {@link org.springframework.web.server.i18n.LocaleContextResolver}. + * @param locale the new locale + * @see #changeLocale(java.util.Locale, java.util.TimeZone) + * @see org.springframework.web.server.i18n.LocaleContextResolver#setLocaleContext */ public void changeLocale(Locale locale) { this.locale = locale; @@ -141,6 +147,13 @@ public void changeLocale(Locale locale) { /** * Change the current locale to the specified locale and time zone context. + *

This change is scoped to this {@code RequestContext} instance for the + * current rendering operation and does not update the + * {@link org.springframework.web.server.i18n.LocaleContextResolver}. + * @param locale the new locale + * @param timeZone the new time zone + * @see org.springframework.context.i18n.SimpleTimeZoneAwareLocaleContext + * @see org.springframework.web.server.i18n.LocaleContextResolver#setLocaleContext */ public void changeLocale(Locale locale, TimeZone timeZone) { this.locale = locale;