[英]How to access resources in external jar file using spring?
我有一个spring项目,它使用不同的库,打包成多个jar。 其中之一(jar)具有xml文件作为资源。
我正在尝试做的就是将这些资源注入Castor marshaller,如下所示:
<bean id="marshaller" class="org.springframework.oxm.castor.CastorMarshaller">
<property name="mappingLocations">
<list>
<value>classpath*:/mapping*.xml</value>
</list>
</property>
</bean>
它不起作用,并且资源数组为空。
我究竟做错了什么?
做了:
<value>classpath:mapping*.xml</value>
前提是,mapping * .xml文件直接存在于类路径(外部jar的根,其直接位于类路径下)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.