/** Message fájlok elérésének beállítása. */
 @Bean
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename("/resource/message/messages");
   messageSource.setFallbackToSystemLocale(false);
   messageSource.setCacheSeconds(0);
   return messageSource;
 }
Beispiel #2
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;
 }