相关疑难解决方法(0)

来自另一家酒店的物业占位符位置

我需要从程序运行之前我不知道的位置将一些属性加载到Spring上下文中.

所以我认为,如果我有一个没有位置的PropertyPlaceholderConfigurer,它会my.location从系统属性读入,然后我可以在上下文中使用该位置:property-placeholder

像这样

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>    
<context:property-placeholder location="${my.location}"/>
Run Code Online (Sandbox Code Playgroud)

但这不起作用也不行 location="classpath:${my.location}"

保罗

java spring

12
推荐指数
2
解决办法
1万
查看次数

标签 统计

java ×1

spring ×1