首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 系统运维 >

Spring读取系统属性的步骤就是先读system.getProperty() 然后再读 System.getenv()

2013-04-05 
Spring读取系统属性的方法就是先读system.getProperty() 然后再读 System.getenv()这是整个调用的Stacktra

Spring读取系统属性的方法就是先读system.getProperty() 然后再读 System.getenv()
这是整个调用的Stacktrace


Thread [main] (Suspended)owns: Object  (id=22)PropertyPlaceholderConfigurer.resolveSystemProperty(String) line: 358PropertyPlaceholderConfigurer.resolvePlaceholder(String, Properties, int) line: 324PropertyPlaceholderConfigurer$PropertyPlaceholderConfigurerResolver.resolvePlaceholder(String) line: 418PropertyPlaceholderHelper.parseStringValue(String, PlaceholderResolver, Set<String>) line: 146PropertyPlaceholderHelper.replacePlaceholders(String, PropertyPlaceholderHelper$PlaceholderResolver) line: 125PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver.resolveStringValue(String) line: 403BeanDefinitionVisitor.resolveStringValue(String) line: 281BeanDefinitionVisitor.resolveValue(Object) line: 202BeanDefinitionVisitor.visitPropertyValues(MutablePropertyValues) line: 140BeanDefinitionVisitor.visitBeanDefinition(BeanDefinition) line: 81PropertyPlaceholderConfigurer.processProperties(ConfigurableListableBeanFactory, Properties) line: 284PropertyPlaceholderConfigurer(PropertyResourceConfigurer).postProcessBeanFactory(ConfigurableListableBeanFactory) line: 75FileSystemXmlApplicationContext(AbstractApplicationContext).invokeBeanFactoryPostProcessors(Collection<BeanFactoryPostProcessor>, ConfigurableListableBeanFactory) line: 663FileSystemXmlApplicationContext(AbstractApplicationContext).invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory) line: 638FileSystemXmlApplicationContext(AbstractApplicationContext).refresh() line: 407FileSystemXmlApplicationContext.<init>(String[], boolean, ApplicationContext) line: 140FileSystemXmlApplicationContext.<init>(String) line: 84Main.main(String[]) line: 14


这是方法内部, 一清二楚啊。。
/** * Resolve the given key as JVM system property, and optionally also as * system environment variable if no matching system property has been found. * @param key the placeholder to resolve as system property key * @return the system property value, or <code>null</code> if not found * @see #setSearchSystemEnvironment * @see java.lang.System#getProperty(String) * @see java.lang.System#getenv(String) */protected String resolveSystemProperty(String key) {try {String value = System.getProperty(key);if (value == null && this.searchSystemEnvironment) {value = System.getenv(key);}return value;}catch (Throwable ex) {if (logger.isDebugEnabled()) {logger.debug("Could not access system property '" + key + "': " + ex);}return null;}}

热点排行