Java Code Examples for org.springframework.context.support.ReloadableResourceBundleMessageSource#setBasenames()

The following examples show how to use org.springframework.context.support.ReloadableResourceBundleMessageSource#setBasenames() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HibernateValidateConfig.java    From spring-boot-api-project-seed with Apache License 2.0 5 votes vote down vote up
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource = new ReloadableResourceBundleMessageSource();
    reloadableResourceBundleMessageSource.setBasenames("classpath:message/ValidationMessages");
    reloadableResourceBundleMessageSource.setUseCodeAsDefaultMessage(true);
    reloadableResourceBundleMessageSource.setDefaultEncoding("UTF-8");
    reloadableResourceBundleMessageSource.setCacheSeconds(60);
    return reloadableResourceBundleMessageSource;
}
 
Example 2
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
 
Example 3
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
 
Example 4
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
 
Example 5
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
 
Example 6
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
 
Example 7
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
 
Example 8
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
 
Example 9
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
 
Example 10
Source File: ErrorHandleConfiguration.java    From onetwo with Apache License 2.0 5 votes vote down vote up
@Bean(name=ExceptionMessageAccessor.BEAN_EXCEPTION_MESSAGE)
public MessageSource exceptionMessageSource(@Autowired BootJFishConfig bootJFishConfig){
	ReloadableResourceBundleMessageSource ms = new ReloadableResourceBundleMessageSource();
	ms.setCacheSeconds(bootJFishConfig.getMessageSource().getCacheSeconds());
	ms.setBasenames("classpath:messages/exception-messages", 
			"classpath:messages/default-exception-messages", 
			"org/hibernate/validator/ValidationMessages");
	return ms;
}
 
Example 11
Source File: JseRsTagTest.java    From sinavi-jfw with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setupClass() {

    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasenames(new String[] {
        "classpath:/jp/co/ctc_g/jse/core/message/JseRsTagTest",
        "classpath:/jp/co/ctc_g/jse/core/message/JseRsTagTestResources"
    });
    MessageSourceLocator.set(messageSource);
}
 
Example 12
Source File: HalfwidthNumberWithCommaEditorTest.java    From sinavi-jfw with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void setupClass() {
    ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();
    source.setBasenames("classpath:/jp/co/ctc_g/jse/core/FrameworkResources");
    MessageSourceLocator.set(source);
}