繁体   English   中英

在Spring XML中通过EL导入spring配置文件

[英]Importing a spring config file via EL in spring XML

在另一个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定义之一中工作,但是我还没有对您的案例进行测试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM