@Bean(name = "messageSource") public ReloadableResourceBundleMessageSource getMessageSource() { ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource(); resource.setBasename("classpath:messages"); resource.setDefaultEncoding("UTF-8"); return resource; }
@Bean public MessageSource messageSource() { ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); messageSource.setBasename("classpath:/messages"); return messageSource; }
@Bean public MessageSource httpErrorMessageSource() { ReloadableResourceBundleMessageSource m = new ReloadableResourceBundleMessageSource(); m.setBasename("classpath:/messages"); m.setDefaultEncoding("UTF-8"); return m; }
@BeforeClass public static void setUpClass() { ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); messageSource.setBasename("classpath:/jp/co/ctc_g/jse/core/message/MessageContextTest"); MessageSourceLocator.set(messageSource); }
@Bean public ReloadableResourceBundleMessageSource messageSource() { ReloadableResourceBundleMessageSource messageBundle = new ReloadableResourceBundleMessageSource(); messageBundle.setBasename("classpath:messages/messages"); messageBundle.setDefaultEncoding("UTF-8"); return messageBundle; }
@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; }
/* * 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 public MessageSource messageSource() { ReloadableResourceBundleMessageSource bundle = new ReloadableResourceBundleMessageSource(); bundle.setBasename("/WEB-INF/messages"); // bundle.setDefaultEncoding("UTF-8"); bundle.setCacheSeconds(1); return bundle; }
@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; }
/** 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 configureMessageSource() { ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); messageSource.setBasename("classpath:messages"); messageSource.setCacheSeconds(5); messageSource.setDefaultEncoding("UTF-8"); 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; }
@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; }
@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; }
@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; }
/** * Override to obtain a local reference to the basenames. * * @see * org.springframework.context.support.ReloadableResourceBundleMessageSource#setBasename(java.lang.String) */ @Override public void setBasename(String basename) { super.setBasename(basename); this.basenames = new String[] {basename}; }