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


Java ReloadableResourceBundleMessageSource.setBasenames方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: messageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
	ReloadableResourceBundleMessageSource messageResource = new ReloadableResourceBundleMessageSource();
	messageResource.setBasenames("WEB-INF/i18n/messages");
	messageResource.setFallbackToSystemLocale(false);
	return messageResource;
}
 
开发者ID:Apress,项目名称:introducing-spring-framework,代码行数:8,代码来源:WebConfig.java

示例5: ResourceBundleManager

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
/**
 * default constructor
 */
private ResourceBundleManager() {
    basenames.add("classpath:com/communote/server/core/i18n/messages");
    basenames.add("classpath:com/communote/server/core/i18n/administration-messages");
    basenames.add("classpath:com/communote/server/core/i18n/installer-messages");
    messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setDefaultEncoding("UTF-8");
    messageSource.setBasenames(basenames.toArray(new String[basenames.size()]));
    messageSource.setFallbackToSystemLocale(false);
}
 
开发者ID:Communote,项目名称:communote-server,代码行数:13,代码来源:ResourceBundleManager.java

示例6: reloadableResourceBundleMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean(name = "messageSource")
public ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource() {
    final ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasenames("classpath:locale");
    messageSource.setDefaultEncoding("UTF-8");
    return messageSource;
}
 
开发者ID:music-for-all,项目名称:music-for-all-application,代码行数:8,代码来源:LocaleConfig.java

示例7: getMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
private static MessageSource getMessageSource()
{
	ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
	messageSource.setBasenames("classpath:/messages");
	messageSource.setUseCodeAsDefaultMessage(true);
	messageSource.setDefaultEncoding("UTF-8");
	messageSource.setCacheSeconds(0);
	return messageSource;
}
 
开发者ID:benetech,项目名称:Secure-App-Generator,代码行数:10,代码来源:SecureAppGeneratorApplication.java

示例8: configureMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean(name = "messageSource")
public MessageSource configureMessageSource() {
	ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
	messageSource.setBasenames(MESSAGE_SOURCE, VERSION_SOURCE);
	messageSource.setCacheSeconds(5);
	return messageSource;
}
 
开发者ID:macielbombonato,项目名称:apolo,代码行数:8,代码来源:WebMvcConfig.java

示例9: exceptionMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean(name=ExceptionMessageAccessor.BEAN_EXCEPTION_MESSAGE)
public MessageSource exceptionMessageSource(@Autowired BootJFishConfig bootJFishConfig){
	ReloadableResourceBundleMessageSource ms = new ReloadableResourceBundleMessageSource();
	ms.setCacheSeconds(bootJFishConfig.getMessageSource().getCacheSeconds());
	ms.setBasenames("classpath:messages/exception-messages", "classpath:messages/default-exception-messages");
	return ms;
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:8,代码来源:ErrorHandleConfiguration.java

示例10: reloadableResourceBundleMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean(name = "messageSource")
@Description("Message source for this context, loaded from localized 'messages_xx' files.")
public ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource() {
	// Files are stored inside src/main/resources
	ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
	messageSource.setBasenames("classpath:messages/messages");
	return messageSource;
}
 
开发者ID:YoannBuch,项目名称:DependencyInjectionAgent,代码行数:9,代码来源:MvcCoreConfig.java

示例11: messageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public MessageSource messageSource() {
	ReloadableResourceBundleMessageSource srbms = new ReloadableResourceBundleMessageSource();
	srbms.setDefaultEncoding("UTF-8");
	srbms.setBasenames("classpath:org/springframework/security/messages",
					   "classpath:org/hibernate/validator/ValidationMessages",
					   "classpath:/messagesApp/messages",
					   "classpath:/messagesSecurity/messages",
					   "classpath:/messages/messages");
	return srbms;
}
 
开发者ID:mv-informatica,项目名称:components-html5,代码行数:12,代码来源:WebConfig.java

示例12: messageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public ReloadableResourceBundleMessageSource messageSource()  throws Exception{
	ReloadableResourceBundleMessageSource bean = new ReloadableResourceBundleMessageSource();
	bean.setDefaultEncoding("UTF-8");
	String[] basenames = messageSourceBasenames().getFilenames();
	if(basenames != null){
		bean.setBasenames(basenames);
	}else{
		String path = "classpath:com/u2ware/springfield/view/thymeleaf/messages";
		bean.setBasenames(path);
	}
	return bean;
}
 
开发者ID:u2ware,项目名称:springfield,代码行数:14,代码来源:BaseMessageConfiguration.java

示例13: reloadableResourceBundleMessageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource() {
    ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();
    //TODO: Move that values to properties
    source.setBasenames("/WEB-INF/locale/imcms", "/WEB-INF/locale/image_archive");
    source.setFallbackToSystemLocale(false);
    source.setUseCodeAsDefaultMessage(true);
    return source;
}
 
开发者ID:imCodePartnerAB,项目名称:imcms,代码行数:10,代码来源:ApplicationConfig.java

示例14: messageSource

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
/**
 * Resolves localized messages*.properties and application.properties files in the application to allow for internationalization. 
    * The messages*.properties files translate Roo generated messages which are part of the admin interface, the application.properties
    * resource bundle localizes all application specific messages such as entity names and menu items.
 */
public @Bean ReloadableResourceBundleMessageSource messageSource () {
	final ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource ();
	
	if (!hasDojoProduction) {
		source.setCacheSeconds (0);
	}
	
	source.setBasenames ("WEB-INF/i18n/messages");
	source.setFallbackToSystemLocale (false);
	
	return source;
}
 
开发者ID:CDS-INSPIRE,项目名称:InSpider,代码行数:18,代码来源:AdminWebMvcConfig.java

示例15: setupClass

import org.springframework.context.support.ReloadableResourceBundleMessageSource; //导入方法依赖的package包/类
@BeforeClass
public static void setupClass() {

    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasenames(new String[] {
        "classpath:/jp/co/ctc_g/jse/core/message/JseRsTagTest",
        "classpath:/jp/co/ctc_g/jse/core/message/JseRsTagTestResources"
    });
    MessageSourceLocator.set(messageSource);
}
 
开发者ID:ctc-g,项目名称:sinavi-jfw,代码行数:11,代码来源:JseRsTagTest.java


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