Skip to content

Instantly share code, notes, and snippets.

@in1t5
Last active January 6, 2017 22:31
Show Gist options
  • Save in1t5/5e57244e3333c2856d0cea8b5d97a385 to your computer and use it in GitHub Desktop.
Save in1t5/5e57244e3333c2856d0cea8b5d97a385 to your computer and use it in GitHub Desktop.
package reproducer;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;
@Configuration
@ComponentScan("reproducer")
public class AppConfig {
@Bean
public MessageSource messageSource() {
final ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
messageSource.setBasenames("i18n/messages");
return messageSource;
}
@Bean
public BeanClass beanClass() {
final BeanClass bean = new BeanClass();
//...configure bean
return bean;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment