public interface ContextMessageSource
LocaleContextHolder| Modifier and Type | Method and Description |
|---|---|
String |
getMessage(String code)
Returns the message in the locale of the current user.
|
String |
getMessage(String code,
Object[] args)
Returns the message in the locale of the current user.
|
String getMessage(String code)
code - the code to lookup up, such as 'calculator.noRateSet'org.springframework.context.NoSuchMessageException - if the message wasn't foundString getMessage(String code, @Nullable Object[] args)
code - the code to lookup up, such as 'calculator.noRateSet'args - an array of arguments that will be filled in for params within the message (params
look like "{0}", "{1,date}", "{2,time}" within a message), * or null if none.org.springframework.context.NoSuchMessageException - if the message wasn't foundCopyright © 2018 Pivotal Software, Inc.. All rights reserved.