在另一个spring xml中导入spring xml,xml文件的位置将在spring中使用EL动态构建。我尝试如下。它不起作用。
<import resource="../core/#{systemProperties['test.demo.enable'] eq 'true'?'XXXX':'YYYY' }/my-context.xml" />
我不确定,但是如果您在EL中完全构建路径,它可能会起作用:
<import resource="#{'../core/'.concat(systemProperties['test.demo.enable'] eq 'true'?'XXXX':'YYYY').concat('/my-context.xml')}" />
它可以在我的春季安全拦截URL定义之一中工作,但是我还没有对您的案例进行测试。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句