Spring   发布时间:2022-04-09  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了java – xml配置文件中的Spring表达式大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

为不同的用户提供不同的属性集很有用.

http://www.springframework.org/scheR_659_11845@a/beans" xmlns:xsi="http://www.w3.org/2001/XMLscheR_659_11845@a-instance" xmlns:context="http://www.springframework.org/scheR_659_11845@a/context" xsi:scheR_659_11845@aLOCATIOn="http://www.springframework.org/scheR_659_11845@a/beans
            http://www.springframework.org/scheR_659_11845@a/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    stemProperties['user.name'] }.properties"/>

执行应用程序时,spring无法识别表达式.上下文没有启动,spring说:类路径资源[path / to / package /#{systemProperties [‘user.name’]} .properties]无法打开

当我用字符串手动替换表达式导致有效资源时,行为是预期的. manual states它应该工作.

spring-context和spring-core(3.1.2-RELEASE)在classpath中.

>春天怎么没有拿起环境变量?
>我愿意接受解决相同功能问题的替代解决方案.

最佳答案
那里不允许使用SpEL表达式;你可以间接做你想做的事,但……

LOCATIOn="classpath:#{systemProperties['foo']}"/>

大佬总结

以上是大佬教程为你收集整理的java – xml配置文件中的Spring表达式全部内容,希望文章能够帮你解决java – xml配置文件中的Spring表达式所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。