コード例 #1
0
 @Bean(name = "messageSource")
 public ReloadableResourceBundleMessageSource getMessageSource() {
   ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
   resource.setBasename("classpath:messages");
   resource.setDefaultEncoding("UTF-8");
   return resource;
 }
コード例 #2
0
 @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;
 }
コード例 #4
0
 @Bean
 public ReloadableResourceBundleMessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageBundle =
       new ReloadableResourceBundleMessageSource();
   messageBundle.setBasename("classpath:messages/messages");
   messageBundle.setDefaultEncoding("UTF-8");
   return messageBundle;
 }
コード例 #5
0
 @Bean
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource bundle = new ReloadableResourceBundleMessageSource();
   bundle.setBasename("/WEB-INF/messages");
   bundle.setDefaultEncoding("ISO-8859-1");
   bundle.setCacheSeconds(1);
   return bundle;
 }
コード例 #6
0
 /*
  * 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;
 }
コード例 #7
0
 @Bean(name = "messageSource")
 public MessageSource configureMessageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename("classpath:messages");
   messageSource.setCacheSeconds(5);
   messageSource.setDefaultEncoding("UTF-8");
   return messageSource;
 }
コード例 #8
0
 @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;
 }
コード例 #10
0
 @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
ファイル: WebMvcConfig.java プロジェクト: maystrovoy/Saladin
 @Bean(name = "messageSource")
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setDefaultEncoding("UTF-8");
   messageSource.setBasename(MESSAGE_SOURCE);
   messageSource.setCacheSeconds(5);
   return messageSource;
 }
コード例 #12
0
 @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
ファイル: MvcConfig.java プロジェクト: Thomas-Adams/holiday
  @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;
  }
コード例 #16
0
 @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;
 }