我在一个Spring项目中有一个Java类,看起来(已编辑)像:
@Component
public class X
{
private static final ApplicationContext CTX = new FileSystemXmlApplicationContext("file:${PATH}/ApplicationContext.xml");
...
我正在寻找关于如何在字符串参数中插入${PATH}的参考资料。PATH作为系统属性传递(java -DPATH = ...),因此我认为它从那里获取,但我找不到描述这种机制的解释。它是否是Spring相关功能,类似于@Value中使用的语法?
Could not resolve placeholder 'PATH' in value "file:${PATH}/ApplicationContext.xml" at org.springframework.context.annotation.ConfigurationClassParser
。因此,这与Spring有关,但我在Spring文档中仍然找不到相关信息。 - DECEMCLMC