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


Java PropertyPlaceholderConfigurer.setIgnoreResourceNotFound方法代码示例

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


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

示例1: propertyPlaceholderConfigurer

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {

  final PropertyPlaceholderConfigurer propConfig =
      new PropertyPlaceholderConfigurer();

  propConfig.setIgnoreResourceNotFound(true);
  String sysPropPath = System.getProperty("app.cfg");

  if (sysPropPath != null) {
    propConfig.setLocation(new FileSystemResource(sysPropPath));
  } else {
    propConfig.setLocation(new ClassPathResource(APP_PROPERTIES));
  }
  return propConfig;
}
 
开发者ID:rebx,项目名称:spring4-mvc-noxml,代码行数:17,代码来源:AppConfig.java

示例2: propertyConfig

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public PropertyPlaceholderConfigurer propertyConfig() {
    PropertyPlaceholderConfigurer placeholderConfigurer = new PropertyPlaceholderConfigurer();
    placeholderConfigurer.setLocation(new ClassPathResource("application-test.properties"));
    placeholderConfigurer.setIgnoreResourceNotFound(true);
    return placeholderConfigurer;
}
 
开发者ID:sdl,项目名称:ecommerce-framework,代码行数:8,代码来源:TestContext.java

示例3: newApplicationConf

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
public static PropertyPlaceholderConfigurer newApplicationConf(boolean searchSystemEnvironment, String... locations){
	Assert.notEmpty(locations);
	PropertyPlaceholderConfigurer ppc = new JFishPropertyPlaceholder();
	ppc.setIgnoreResourceNotFound(true);
	ppc.setIgnoreUnresolvablePlaceholders(true);
	ppc.setSearchSystemEnvironment(searchSystemEnvironment);
	List<Resource> resources = new ArrayList<Resource>();
	for(String path : locations){
		resources.add(new ClassPathResource(path));
	}
	ppc.setLocations(resources.toArray(new Resource[resources.size()]));
	return ppc;
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:14,代码来源:SpringUtils.java

示例4: propertyPlaceholderConfigurer

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
    
    PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
    ppc.setIgnoreResourceNotFound(true);
    final Properties properties = new Properties();
    properties.setProperty("cf.resource", ApiControllerTest.CF_RESOURCE);
    properties.setProperty("cf.cli.version", "");
    properties.setProperty("cf.cli.url", "");
    properties.setProperty("platform.version", "0.1");
    properties.setProperty("platform.coreorg", "coreOrg");
    ppc.setProperties(properties);
 
    return ppc;
}
 
开发者ID:trustedanalytics,项目名称:platform-context,代码行数:16,代码来源:TestConfiguration.java

示例5: propertyPlaceholderConfigurer

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
    
    PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
    ppc.setIgnoreResourceNotFound(true);
    final Properties properties = new Properties();
    properties.setProperty("demo.data", ResourceControllerTest.CF_RESOURCE);
    ppc.setProperties(properties);
 
    return ppc;
}
 
开发者ID:trustedanalytics,项目名称:resource-server-template,代码行数:12,代码来源:TestConfiguration.java

示例6: propertyPlaceholderConfigurer

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
/**
 * Returns a general properties placeholder configurer based on
 * {@link #logSnifferProperties()}.
 * 
 * @param props
 *            autowired logSnifferProperties bean
 * @return A general properties placeholder configurer.
 * @throws IOException
 */
@Bean
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
@Autowired
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer(
		@Qualifier(BEAN_LOGSNIFFER_PROPS) final Properties props) throws IOException {
	final PropertyPlaceholderConfigurer c = new PropertyPlaceholderConfigurer();
	c.setIgnoreResourceNotFound(true);
	c.setIgnoreUnresolvablePlaceholders(true);
	c.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE);
	c.setProperties(props);
	return c;
}
 
开发者ID:logsniffer,项目名称:logsniffer,代码行数:22,代码来源:CoreAppConfig.java


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