當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。