Example usage for org.springframework.context.support ReloadableResourceBundleMessageSource setDefaultEncoding

List of usage examples for org.springframework.context.support ReloadableResourceBundleMessageSource setDefaultEncoding

Introduction

In this page you can find the example usage for org.springframework.context.support ReloadableResourceBundleMessageSource setDefaultEncoding.

Prototype

public void setDefaultEncoding(@Nullable String defaultEncoding) 

Source Link

Document

Set the default charset to use for parsing properties files.

Usage

From source file:echec.spring.SpringConfig.java

@Bean(name = "messageSource")
public ReloadableResourceBundleMessageSource getMessageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasename("classpath:messages");
    resource.setDefaultEncoding("UTF-8");
    return resource;
}

From source file:fi.helsinki.opintoni.config.LocaleConfiguration.java

@Bean
public MessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/i18n/messages");
    messageSource.setDefaultEncoding("UTF-8");
    messageSource.setCacheSeconds(propertyResolver.getProperty("cacheSeconds", Integer.class, 1));
    return messageSource;
}

From source file:it.cineca.pst.huborcid.config.ThymeleafConfiguration.java

@Bean
@Description("Spring mail message resolver")
public MessageSource emailMessageSource() {
    log.info("loading non-reloadable mail messages resources");
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/mails/messages/messages");
    messageSource.setDefaultEncoding(CharEncoding.UTF_8);
    return messageSource;
}

From source file:br.com.joaops.smt.configuration.WebConfig.java

private MessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setDefaultEncoding("UTF-8");
    messageSource.setBasenames("classpath:/org/springframework/security/messages",
            "classpath:/org/hibernate/validator/ValidationMessages",
            "classpath:/br/com/joaops/smt/i18n/messages");
    messageSource.setCacheSeconds(0); //Escolher um valor do cache na hora da implantao. Para testes deixar como '0' zero
    messageSource.setFallbackToSystemLocale(Boolean.TRUE);
    return messageSource;
}

From source file:com.project.framework.configuration.WebMvcConfig.java

@Bean
public MessageSource messageSource() {
    ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();
    source.setBasenames("/resources/bundles/languages/language");
    source.setDefaultEncoding("UTF-8");
    source.setUseCodeAsDefaultMessage(true);
    return source;
}

From source file:org.osiam.configuration.WebApplicationConfig.java

@Bean
public MessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("file:" + osiamHome + "/i18n/login");
    messageSource.setDefaultEncoding("utf-8");
    messageSource.setCacheSeconds(-1);//  www. j a v a  2 s  .  c om
    return messageSource;
}

From source file:com.uimirror.auth.conf.DispatcherConfig.java

@Bean
public MessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:locale/messages");
    messageSource.setDefaultEncoding(Constants.UTF_8);
    return messageSource;
}

From source file:com.devnexus.ting.config.WebConfig.java

@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:messages");
    messageSource.setDefaultEncoding("utf-8");
    messageSource.setCacheSeconds(0);/*from   w ww  .j  av a 2s.  com*/
    return messageSource;
}

From source file:magoffin.matt.sobriquet.web.config.MvcConfig.java

@Bean(name = "messageSource")
public MessageSource getMessageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasename("/WEB-INF/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setCacheSeconds(i18nCacheSecs);
    return resource;
}

From source file:org.pavlov.springmvcjavaconfig.config.WebConfig.java

@Bean
public MessageSource messageSource() {
    ReloadableResourceBundleMessageSource rrbm = new ReloadableResourceBundleMessageSource();
    rrbm.setBasename("locale/ApplicationMessageSource");
    rrbm.setDefaultEncoding("UTF-8");
    return rrbm;//www.j  a  v  a 2  s.c  o m
}