@Bean(name = "messageSource")
 public ReloadableResourceBundleMessageSource getMessageSource() {
   ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
   resource.setBasename("classpath:messages");
   resource.setDefaultEncoding("UTF-8");
   return resource;
 }
Exemplo n.º 2
0
 @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;
 }
Exemplo n.º 4
0
 @BeforeClass
 public static void setUpClass() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename("classpath:/jp/co/ctc_g/jse/core/message/MessageContextTest");
   MessageSourceLocator.set(messageSource);
 }
Exemplo n.º 5
0
 @Bean
 public ReloadableResourceBundleMessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageBundle =
       new ReloadableResourceBundleMessageSource();
   messageBundle.setBasename("classpath:messages/messages");
   messageBundle.setDefaultEncoding("UTF-8");
   return messageBundle;
 }
Exemplo n.º 6
0
 @Bean(name = "messageSource")
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename(MESSAGE_SOURCE);
   messageSource.setCacheSeconds(5);
   return messageSource;
 }
Exemplo n.º 7
0
 @Bean
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource messageSource =
       new ReloadableResourceBundleMessageSource();
   messageSource.setBasename("/WEB-INF/messages/messages");
   messageSource.setCacheSeconds(15);
   return messageSource;
 }
Exemplo n.º 8
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;
 }
 @Bean
 public MessageSource messageSource() {
   ReloadableResourceBundleMessageSource bundle = new ReloadableResourceBundleMessageSource();
   bundle.setBasename("/WEB-INF/messages");
   //	bundle.setDefaultEncoding("UTF-8");
   bundle.setCacheSeconds(1);
   return bundle;
 }
Exemplo n.º 10
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;
 }
Exemplo n.º 11
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;
 }
 @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;
 }
Exemplo n.º 14
0
 @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;
 }
Exemplo n.º 15
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;
 }
Exemplo n.º 16
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;
 }
 /**
  * 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};
 }