@RequestScope public class HttpLocalizedMessageSource extends AbstractLocalizedMessageSource<HttpRequest<?>> implements RequestAware
RequestScope
which uses the current HttpRequest
to resolve the locale and hence return the localized messages.Constructor and Description |
---|
HttpLocalizedMessageSource(LocaleResolver<HttpRequest<?>> localeResolver,
MessageSource messageSource) |
Modifier and Type | Method and Description |
---|---|
protected Locale |
getLocale() |
void |
setRequest(HttpRequest<?> request)
Provides the request directly after bean creation.
|
getMessage, getMessage, getMessage, resolveLocale
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMessageOrDefault, getMessageOrDefault, getMessageOrDefault
public HttpLocalizedMessageSource(LocaleResolver<HttpRequest<?>> localeResolver, MessageSource messageSource)
localeResolver
- The locale resolvermessageSource
- The message source@NonNull protected Locale getLocale()
getLocale
in class AbstractLocalizedMessageSource<HttpRequest<?>>
public void setRequest(HttpRequest<?> request)
RequestAware
setRequest
in interface RequestAware
request
- The current request