@Bean public MessageSource messageSource() { ReloadableResourceBundleMessageSource bundle = new ReloadableResourceBundleMessageSource(); bundle.setBasename("/WEB-INF/messages"); // bundle.setDefaultEncoding("UTF-8"); 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 messageSource() { ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); messageSource.setBasename(MESSAGE_SOURCE); messageSource.setCacheSeconds(5); return messageSource; }
@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; }
@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; }
/** 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; }
@Bean(name = "messageSource") public MessageSource getMessageSources() { ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); messageSource.setBasenames("/WEB-INF/resources/properties/clientMessages"); messageSource.setCacheSeconds(0); return messageSource; }
@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; }
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; }
@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; }
@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); }