这里的问题是你正在尝试使用属性占位符语法配置属性占位符:)这有点像鸡和蛋的情况
${my.location}-spring在配置了属性占位符之前无法解析你的占位符。这并不令人满意,但是你可以通过使用更明确的语法来弥补它:
<bean > <property name="location"> <bean factory-method="getenv"> <constructor-arg value="my.location"/> </bean> </property></bean>

这里的问题是你正在尝试使用属性占位符语法配置属性占位符:)这有点像鸡和蛋的情况
${my.location}-spring在配置了属性占位符之前无法解析你的占位符。这并不令人满意,但是你可以通过使用更明确的语法来弥补它:
<bean > <property name="location"> <bean factory-method="getenv"> <constructor-arg value="my.location"/> </bean> </property></bean>