我正在寻找在MessageSource接口中以代码添加条目的方法。例如:
@Bean
public MessageSource messageSource() {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.setBasename("classpath:messages");
messageSource.setDefaultEncoding("UTF-8");
messageSource.addProperty("x.y.z","Input is required");
return messageSource;
}