Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getMessageSource internally in RequestContext #32926

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -661,7 +661,7 @@ public String getMessage(String code, @Nullable List<?> args, String defaultMess
* @return the message
*/
public String getMessage(String code, @Nullable Object[] args, String defaultMessage, boolean htmlEscape) {
String msg = this.webApplicationContext.getMessage(code, args, defaultMessage, getLocale());
String msg = getMessageSource().getMessage(code, args, defaultMessage, getLocale());
if (msg == null) {
return "";
}
@@ -709,7 +709,7 @@ public String getMessage(String code, @Nullable List<?> args) throws NoSuchMessa
* @throws org.springframework.context.NoSuchMessageException if not found
*/
public String getMessage(String code, @Nullable Object[] args, boolean htmlEscape) throws NoSuchMessageException {
String msg = this.webApplicationContext.getMessage(code, args, getLocale());
String msg = getMessageSource().getMessage(code, args, getLocale());
return (htmlEscape ? HtmlUtils.htmlEscape(msg) : msg);
}

@@ -731,7 +731,7 @@ public String getMessage(MessageSourceResolvable resolvable) throws NoSuchMessag
* @throws org.springframework.context.NoSuchMessageException if not found
*/
public String getMessage(MessageSourceResolvable resolvable, boolean htmlEscape) throws NoSuchMessageException {
String msg = this.webApplicationContext.getMessage(resolvable, getLocale());
String msg = getMessageSource().getMessage(resolvable, getLocale());
return (htmlEscape ? HtmlUtils.htmlEscape(msg) : msg);
}