在spring bean中导入资源

时间:2016-10-09 10:32:23

标签: xml spring spring-mvc import

我想在spring bean中导入xml资源文件,所以我该怎么办呢?我已经尝试了下面的代码,但它没有用。

<beans profile="en_US">
<import resource="Test.xml" />
</beans>

1 个答案:

答案 0 :(得分:0)

尝试在导入标记中使用classpath,如下所示:

<beans profile="en_US">
    <import resource="classpath:Test.xml" />
</beans>

假设Test.xml位于类路径中。

相关问题