@Slf4j
public class CustomReloadableResourceBundleMessageSource extends ReloadableResourceBundleMessageSource {
public CustomReloadableResourceBundleMessageSource() {
}
public String getMessage(String code, String defaultValue) throws NoSuchMessageException{
return getMessage(code,null,defaultValue,LocaleContextHolder.getLocale());
}
public String getMessage(String code) throws NoSuchMessageException{
return getMessage(code,null,LocaleContextHolder.getLocale());
}
public String getMessage(String code, Object[] args) throws NoSuchMessageException{
return getMessage(code,args,LocaleContextHolder.getLocale());
}
public Map<String, String> getPropertiesMap() {
return getPropertiesMap(LocaleContextHolder.getLocale());
}
public Map<String, String> getPropertiesMap(Locale locale) {
Map<String, String> altLabels = new HashMap<String, String>();
PropertiesHolder propertiesHolder = getMergedProperties(locale);
Properties properties = propertiesHolder.getProperties();
for (Object key : properties.keySet()) {
altLabels.put((String) key, (String) properties.get(key));
}
return altLabels;
}
}
상속받아서 저도 사용하고있습니다. ^^편해요