从Tomcat中的外部目录读取可重新加载的xml文件

时间:2016-05-04 10:17:34

标签: java xml hibernate tomcat

我的要求类似于Reading reloadable xml file from external Tomcat directory

我需要将我的hibernate xml和属性文件放在爆炸的war文件之外,即在tomcat / my_folder中

我使用以下代码通过 applicationcontext.xml 导入此xml和属性文件。

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="location" value="file:D:/my_folder/jdbc.properties" />  
</bean>

<!-- Load Hibernate related configuration -->
<import resource="file:D:/my_folder/hibernate-context.xml" />

这些文件的导入工作正常,但是当我更新这些文件时,除非我重新启动Tomcat,否则更改不会反映出来。

  

我还在tomcat服务器中将 reloadabale属性设为true   context.xml中。我还添加了这些文件的条目    WatchedResource 标记。但没有任何作用,因为这只会在爆炸的战争中检查文件。

请帮我解决这个问题。

0 个答案:

没有答案