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:org.davidmendoza.fileUpload.config.WebConfig.java

/**
 * Messages to support internationalization/localization.
 * @return /*from  w w w . ja  va2s . c  om*/
 */
@Bean
public MessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:messages");
    messageSource.setDefaultEncoding("UTF-8");
    messageSource.setCacheSeconds(0);
    return messageSource;
}

From source file:org.davidmendoza.fileUpload.config.WebConfig.java

@Override
public Validator getValidator() {
    LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:messages");
    messageSource.setDefaultEncoding("UTF-8");
    messageSource.setCacheSeconds(0);//from w  w  w. j av a  2 s  .c  o m
    factory.setValidationMessageSource(messageSource);
    return factory;
}

From source file:mx.edu.um.eventosum.config.WebConfig.java

/**
 * Messages to support internationalization/localization.
 *//*www  . ja v  a 2 s  .c o  m*/
@Bean
public MessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:messages");
    messageSource.setDefaultEncoding("UTF-8");
    return messageSource;
}

From source file:mx.edu.um.eventosum.config.WebConfig.java

@Override
public Validator getValidator() {
    LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:messages");
    messageSource.setDefaultEncoding("UTF-8");
    factory.setValidationMessageSource(messageSource);
    return factory;
}

From source file:org.fenixedu.bennu.spring.BennuSpringConfiguration.java

@Bean
public MessageSource messageSource(ApplicationContext context) {
    ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();
    source.setDefaultEncoding("UTF-8");
    final String[] baseNames = getBaseNames(context).toArray(new String[0]);
    logger.debug("Adding basenames by @BennuSpringModule configuration: {}", Arrays.toString(baseNames));
    source.setBasenames(baseNames);/*from w  w  w  .jav a2 s  .c om*/
    // Reload resources only when in development mode
    source.setCacheSeconds(bennuCoreConfiguration().developmentMode() ? 1 : -1);

    // Allow using the message code as the message itself, as it is preferable
    // to have an interface without a proper label, than one that doesn't work at all
    source.setUseCodeAsDefaultMessage(true);
    return source;
}

From source file:it.f2informatica.webapp.WebApplicationConfig.java

@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasenames(basenames());
    messageSource.setDefaultEncoding("UTF-8");
    messageSource.setCacheSeconds(1);/*from  ww w  .  j av  a  2  s  .  com*/
    messageSource.setFallbackToSystemLocale(false);
    return messageSource;
}

From source file:br.com.semanticwot.cd.conf.AppWebConfiguration.java

@Bean
public MessageSource messageSource() { // Mtodo para disponibilizar arquivos de mensagens
    ReloadableResourceBundleMessageSource bundle = new ReloadableResourceBundleMessageSource();
    bundle.setBasename("/WEB-INF/messages/messages");
    bundle.setDefaultEncoding("UTF-8");
    bundle.setCacheSeconds(1);//w  w w. j ava2s .  c  o m
    return bundle;
}

From source file:org.lightadmin.core.config.context.LightAdminContextConfiguration.java

@Bean
public MessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:messages");
    messageSource.setDefaultEncoding("UTF-8");
    messageSource.setCacheSeconds(0);/*from  w  w  w.j  av  a  2  s.  co  m*/
    messageSource.setFallbackToSystemLocale(false);
    return messageSource;
}

From source file:com.devnexus.ting.web.config.PersistenceConfig.java

@Bean
ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:messages");
    messageSource.setDefaultEncoding("utf-8");
    messageSource.setCacheSeconds(0);//w  w  w .java 2  s  .  co  m
    return messageSource;
}

From source file:com.github.dbourdette.glass.SpringConfig.java

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