Ejemplo n.º 1
0
 @Bean
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource bundle = new ReloadableResourceBundleMessageSource();
   bundle.setBasename("/WEB-INF/messages");
   //	bundle.setDefaultEncoding("UTF-8");
   bundle.setCacheSeconds(1);
   return bundle;
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
0
 @Bean(name = "messageSource")
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename(MESSAGE_SOURCE);
   messageSource.setCacheSeconds(5);
   return messageSource;
 }
Ejemplo n.º 4
0
 @Bean
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename("/WEB-INF/messages/messages");
   messageSource.setCacheSeconds(15);
   return messageSource;
 }
 @Bean(name = "messageSource")
 public MessageSource configureMessageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename("classpath:messages");
   messageSource.setCacheSeconds(5);
   messageSource.setDefaultEncoding("UTF-8");
   return messageSource;
 }
Ejemplo n.º 6
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;
 }
Ejemplo n.º 8
0
 /** 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;
 }
Ejemplo n.º 9
0
  @Bean(name = "messageSource")
  public MessageSource getMessageSources() {
    ReloadableResourceBundleMessageSource messageSource =
        new ReloadableResourceBundleMessageSource();
    messageSource.setBasenames("/WEB-INF/resources/properties/clientMessages");
    messageSource.setCacheSeconds(0);

    return messageSource;
  }
Ejemplo n.º 10
0
 @Bean(name = "messageSource")
 public MessageSource configureMessageSource() {
   logger.debug("setting up message source");
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename(MESSAGE_SOURCE);
   messageSource.setCacheSeconds(5);
   messageSource.setDefaultEncoding("UTF-8");
   return messageSource;
 }
Ejemplo n.º 11
0
 protected static void initMessageSourceAccessor() {
   String[] basenames = new String[set.size()];
   set.toArray(basenames);
   ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource =
       new ReloadableResourceBundleMessageSource();
   reloadableResourceBundleMessageSource.setBasenames(basenames);
   reloadableResourceBundleMessageSource.setCacheSeconds(5);
   accessor = new MessageSourceAccessor(reloadableResourceBundleMessageSource);
   messageSource = reloadableResourceBundleMessageSource;
 }
Ejemplo n.º 12
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;
 }
Ejemplo n.º 13
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;
 }
 @Override
 public void setCacheSeconds(int cacheSeconds) {
   this.pluginCacheMillis = (cacheSeconds * 1000);
   super.setCacheSeconds(cacheSeconds);
 }
 @Override
 public void setCacheSeconds(int cacheSeconds) {
   this.cacheMilliseconds = cacheSeconds * 1000;
   super.setCacheSeconds(cacheSeconds);
 }