当前位置: 首页>>代码示例>>Java>>正文


Java ReloadableResourceBundleMessageSource.setDefaultEncoding方法代码示例

本文整理汇总了Java中org.springframework.context.support.ReloadableResourceBundleMessageSource.setDefaultEncoding方法的典型用法代码示例。如果您正苦于以下问题:Java ReloadableResourceBundleMessageSource.setDefaultEncoding方法的具体用法?Java ReloadableResourceBundleMessageSource.setDefaultEncoding怎么用?Java ReloadableResourceBundleMessageSource.setDefaultEncoding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.context.support.ReloadableResourceBundleMessageSource的用法示例。


在下文中一共展示了ReloadableResourceBundleMessageSource.setDefaultEncoding方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: messageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean(name = "messageSource")
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageBundle = new ReloadableResourceBundleMessageSource();
    messageBundle.setBasename("classpath:messages/messages");
    messageBundle.setDefaultEncoding("UTF-8");
    return messageBundle;
}
 
开发者ID:rovaniemi,项目名称:remember-me-back,代码行数:8,代码来源:CorsConfiguration.java

示例2: initMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@PostConstruct
protected void initMessageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:messages/conversation");
    messageSource.setDefaultEncoding("utf-8");
    messageSource.setCacheSeconds(3600);

    if (externalResourceBundle != null) {
        ReloadableResourceBundleMessageSource external = new ReloadableResourceBundleMessageSource();
        external.setBasename(externalResourceBundle);
        external.setDefaultEncoding("utf-8");
        external.setCacheSeconds(500);
        external.setParentMessageSource(messageSource);

        this.messageSource = external;
    } else {
        this.messageSource = messageSource;
    }
}
 
开发者ID:redlink-gmbh,项目名称:smarti,代码行数:20,代码来源:SpeakService.java

示例3: messageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean(name = "messageSource")
public MessageSource messageSource() {
    // MessageSource configuration for localized messages.
    final ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();

    source.setBasenames("classpath:/i18n/messages", "classpath:ValidationMessages");
    source.setUseCodeAsDefaultMessage(true);
    source.setFallbackToSystemLocale(false);
    source.setDefaultEncoding(StandardCharsets.ISO_8859_1.name());

    if (runtimeEnvironmentUtil.isDevelopmentEnvironment()) {
        // Check for updates on every refresh, otherwise cache forever
        source.setCacheSeconds(1);
    }

    return source;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:18,代码来源:LocalizationConfig.java

示例4: messageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean(name = "messageSource")
public MessageSource messageSource() {
	ReloadableResourceBundleMessageSource reloadMessage = new ReloadableResourceBundleMessageSource();
	reloadMessage.setBasename("classpath:/messages");
	reloadMessage.setDefaultEncoding("UTF-8");
	reloadMessage.setCacheSeconds(0);
	return reloadMessage;
}
 
开发者ID:grantharper,项目名称:security-demo,代码行数:9,代码来源:WebConfiguration.java

示例5: messageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:9,代码来源:WebMvcConfig.java

示例6: getMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean(name = "messageSource")
public MessageSource getMessageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.addBasenames("classpath:/messages/alert-triggers");
    messageSource.addBasenames("classpath:/messages/applications");
    messageSource.addBasenames("classpath:/messages/device-model");
    messageSource.addBasenames("classpath:/messages/devices");
    messageSource.addBasenames("classpath:/messages/devices-config");
    messageSource.addBasenames("classpath:/messages/gateways");
    messageSource.addBasenames("classpath:/messages/locations");
    messageSource.addBasenames("classpath:/messages/rest-destination");
    messageSource.addBasenames("classpath:/messages/routes");
    messageSource.addBasenames("classpath:/messages/transformations");
    messageSource.addBasenames("classpath:/messages/users");
    messageSource.addBasenames("classpath:/messages/tenants");
    messageSource.addBasenames("classpath:/messages/health-alert");
    messageSource.addBasenames("classpath:/mail/MailMessages");
    messageSource.setDefaultEncoding("UTF-8");

    return messageSource;
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:22,代码来源:WebMvcConfig.java

示例7: configureMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
public void configureMessageSource(ReloadableResourceBundleMessageSource messageSource)
{
    ApplicationConfiguration appConfig = appConfig();

    MessageSourceConfig config = new DefaultMessageSourceConfig();
    config.addBaseName("WEB-INF/messages/Messages");
    config.setCacheSeconds(appConfig.isOptimizeResources() ? -1 : DEFAULT_REFRESH_INTERVALL);
    config.setDefaultEncoding("UTF-8");

    configurer.configureMessageSource(config);

    messageSource.setCacheSeconds(config.getCacheSeconds() != null ? config.getCacheSeconds() : -1);

    if (!CollectionUtils.isEmpty(config.getBaseNames()))
    {
        messageSource.setBasenames(config.getBaseNames().toArray(new String[config.getBaseNames().size()]));
    }

    messageSource.setDefaultEncoding(config.getDefaultEncoding());
}
 
开发者ID:furti,项目名称:spring-web-extended,代码行数:21,代码来源:SpringWebExtendedConfigurerConfig.java

示例8: messageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource bundleMessageSource = new ReloadableResourceBundleMessageSource();
    bundleMessageSource.setBasename("classpath:i18n/messages");
    bundleMessageSource.setCacheSeconds(1800);
    bundleMessageSource.setDefaultEncoding("UTF-8");
    return bundleMessageSource;
}
 
开发者ID:WickedWitchWarsaw,项目名称:ThymeleafSpringDemo,代码行数:9,代码来源:I18NConfig.java

示例9: emailMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@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;
}
 
开发者ID:GastonMauroDiaz,项目名称:buenojo,代码行数:10,代码来源:ThymeleafConfiguration.java

示例10: apiErrorMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean(name = "apiErrorMessageSource")
public ReloadableResourceBundleMessageSource apiErrorMessageSource() {
    ReloadableResourceBundleMessageSource messageBundle = new ReloadableResourceBundleMessageSource();
    messageBundle.setBasename("classpath:error_messages");
    messageBundle.setDefaultEncoding("UTF-8");
    messageBundle.setUseCodeAsDefaultMessage(true);
    return messageBundle;
}
 
开发者ID:barrykalok,项目名称:spring-boot-drools-example,代码行数:9,代码来源:CommonConfig.java

示例11: messageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public MessageSource messageSource() { // Método para disponibilizar arquivos de mensagens
    ReloadableResourceBundleMessageSource bundle
            = new ReloadableResourceBundleMessageSource();
    bundle.setBasename("/WEB-INF/messages/messages");
    bundle.setDefaultEncoding("UTF-8");
    bundle.setCacheSeconds(1);
    return bundle;
}
 
开发者ID:nailtonvieira,项目名称:pswot-cloud-java-spring-webapp,代码行数:10,代码来源:AppWebConfiguration.java

示例12: getMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean(name = "messageSource")
public MessageSource getMessageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.addBasenames(
            "/WEB-INF/i18n/dateformats",
            "/WEB-INF/i18n/destinations",
            "/WEB-INF/i18n/devices",
            "/WEB-INF/i18n/email",
            "/WEB-INF/i18n/error",
            "/WEB-INF/i18n/global",
            "/WEB-INF/i18n/languages",
            "/WEB-INF/i18n/loglevels",
            "/WEB-INF/i18n/menu",
            "/WEB-INF/i18n/routes",
            "/WEB-INF/i18n/timezones",
            "/WEB-INF/i18n/tokens",
            "/WEB-INF/i18n/transformations",
            "/WEB-INF/i18n/usernotifications",
            "/WEB-INF/i18n/users",
            "/WEB-INF/i18n/visualization",
            "classpath:/messages/alert-triggers",
            "classpath:/messages/applications",
            "classpath:/messages/device-model",
            "classpath:/messages/devices",
            "classpath:/messages/rest-destination",
            "classpath:/messages/routes",
            "classpath:/messages/transformations",
            "classpath:/messages/rest-destination",
            "classpath:/messages/users",
            "classpath:/messages/tenants",
            "classpath:/messages/applications",
            "classpath:/messages/device-model",
            "classpath:/messages/health-alert",
            "classpath:/mail/MailMessages");
    messageSource.setDefaultEncoding("UTF-8");
    return messageSource;
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:38,代码来源:MessageSourceConfig.java

示例13: getMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean(name = "messageSource")
public MessageSource getMessageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.addBasenames(
            "classpath:/messages/devices",
            "classpath:/messages/routes",
            "classpath:/messages/integration",
            "classpath:/messages/transformations",
            "classpath:/messages/devices-config",
            "classpath:/messages/applications");
    
    messageSource.setDefaultEncoding("UTF-8");
    return messageSource;
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:15,代码来源:WebMvcConfig.java

示例14: DeviceDataURLs

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
public DeviceDataURLs(Device device, Locale locale) {
	ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
       messageSource.setBasename("classpath:/messages/devices");
       messageSource.setDefaultEncoding("UTF-8");

       httpHostName = pubServerConfig.getHttpHostname();
       httpPort = pubServerConfig.getHttpPort();
       httpsPort = pubServerConfig.getHttpsPort();
       mqttHostName = pubServerConfig.getMqttHostName();
       mqttPort = pubServerConfig.getMqttPort();
       mqttTlsPort = pubServerConfig.getMqttTlsPort();
       context = pubServerConfig.getHttpCtx();
       channel = messageSource.getMessage("model.device.channel", null, locale);
       username = device.getApiKey();

       if (httpHostName.equalsIgnoreCase("localhost")) {
           this.httpHostName = "<ip>";
       }
       if (mqttHostName.equalsIgnoreCase("localhost")) {
       	mqttHostName = "<ip>";
       }
       if (StringUtils.hasText(device.getApplication().getDataApiDomain())) {
       	httpHostName = device.getApplication().getDataApiDomain();
       }        
       if (StringUtils.hasText(device.getApplication().getDataMqttDomain())) {
       	mqttHostName = device.getApplication().getDataMqttDomain();
       }
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:29,代码来源:DeviceRegisterService.java

示例15: messageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Primary
@Bean(name = "messageSource")
public ReloadableResourceBundleMessageSource messageSource() { // @todo not working
    ReloadableResourceBundleMessageSource messageBundle = new ReloadableResourceBundleMessageSource();
    messageBundle.setBasename("classpath:messages");
    messageBundle.addBasenames("classpath:messages", "classpath:validation");
    messageBundle.setUseCodeAsDefaultMessage(true);
    messageBundle.setDefaultEncoding("UTF-8");
    messageBundle.setFallbackToSystemLocale(true);

    return messageBundle;
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:13,代码来源:AppConfiguration.java


注:本文中的org.springframework.context.support.ReloadableResourceBundleMessageSource.setDefaultEncoding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。