@Bean(name = "messageSource")
 public ReloadableResourceBundleMessageSource getMessageSource() {
   ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
   resource.setBasename("classpath:messages");
   resource.setDefaultEncoding("UTF-8");
   return resource;
 }
 @Bean
 public MessageSource httpErrorMessageSource() {
   ReloadableResourceBundleMessageSource m = new ReloadableResourceBundleMessageSource();
   m.setBasename("classpath:/messages");
   m.setDefaultEncoding("UTF-8");
   return m;
 }
示例#3
0
 @Bean
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource ret = new ReloadableResourceBundleMessageSource();
   ret.setBasenames(new String[] {"/resources/messages/messages"});
   ret.setDefaultEncoding("UTF-8");
   return ret;
 }
 @Bean
 public ReloadableResourceBundleMessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageBundle =
       new ReloadableResourceBundleMessageSource();
   messageBundle.setBasename("classpath:messages/messages");
   messageBundle.setDefaultEncoding("UTF-8");
   return messageBundle;
 }
 @Bean
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource bundle = new ReloadableResourceBundleMessageSource();
   bundle.setBasename("/WEB-INF/messages");
   bundle.setDefaultEncoding("ISO-8859-1");
   bundle.setCacheSeconds(1);
   return bundle;
 }
 /*
  * Configure MessageSource to provide internationalized messages
  */
 @Bean
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource bundle = new ReloadableResourceBundleMessageSource();
   bundle.setBasename("messages");
   bundle.setDefaultEncoding(TEMPLATE_RESOLVER_CHAR_ENCODING);
   bundle.setCacheSeconds(5);
   return bundle;
 }
 @Bean(name = "messageSource")
 public MessageSource configureMessageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename("classpath:messages");
   messageSource.setCacheSeconds(5);
   messageSource.setDefaultEncoding("UTF-8");
   return messageSource;
 }
 @Bean
 public ReloadableResourceBundleMessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   String[] resources = {"classpath:/labels", "classpath:/message"};
   messageSource.setBasenames(resources);
   messageSource.setDefaultEncoding("UTF-8");
   return messageSource;
 }
示例#9
0
 @Bean
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename("classpath:/i18n/messages");
   messageSource.setDefaultEncoding("UTF-8");
   messageSource.setCacheSeconds(propertyResolver.getProperty("cache-seconds", Integer.class, -1));
   return messageSource;
 }
 @Bean(name = "messageSource")
 public MessageSource getMessageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setCacheSeconds(1);
   messageSource.setBasenames("file:./resources/messages");
   messageSource.setDefaultEncoding("UTF-8");
   return messageSource;
 }
示例#11
0
 @Bean(name = "messageSource")
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setDefaultEncoding("UTF-8");
   messageSource.setBasename(MESSAGE_SOURCE);
   messageSource.setCacheSeconds(5);
   return messageSource;
 }
 @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;
 }
示例#13
0
文件: WebConfig.java 项目: jdmr/demo
 @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;
 }
示例#14
0
 @Bean(name = "messageSource")
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename("classpath:/messages/message");
   messageSource.setDefaultEncoding("UTF-8");
   if (environment.acceptsProfiles("dev")) {
     messageSource.setCacheSeconds(0);
   }
   return messageSource;
 }
示例#15
0
  @Bean(name = "messageSource")
  public MessageSource messageSource() {

    ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource =
        new ReloadableResourceBundleMessageSource();
    reloadableResourceBundleMessageSource.setBasenames(
        "classpath:META-INF/i18n/holiday", "classpath:ValidationMessages");
    reloadableResourceBundleMessageSource.setDefaultEncoding("UTF-8");
    reloadableResourceBundleMessageSource.setFallbackToSystemLocale(false);
    reloadableResourceBundleMessageSource.setUseCodeAsDefaultMessage(true);
    reloadableResourceBundleMessageSource.setCacheSeconds(5);
    return reloadableResourceBundleMessageSource;
  }
 @Bean
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource ms = new ReloadableResourceBundleMessageSource();
   ms.setDefaultEncoding("UTF-8");
   ms.setCacheSeconds(600);
   ms.setFallbackToSystemLocale(false);
   ms.setBasenames(
       new String[] {
         "/WEB-INF/i18n/labels",
         "/WEB-INF/i18n/buttons",
         "/WEB-INF/i18n/messages",
         "/WEB-INF/i18n/titles"
       });
   return ms;
 }