我使用的是带有Spring 3.0.x的Dozer。下面是我的mapper bean定义:
<bean id="mapper" class="org.dozer.DozerBeanMapper" lazy-init="true">
<property name="mappingFiles">
<list>
<value>dozer-bean-mappings.xml</value>
</list>
</property>
</bean>我想把dozer.properties文件放在src/main/resources/conf/app/dozer.properties中。
如何指定自定义dozer.properties位置?
发布于 2011-07-03 22:45:36
<bean id="org.dozer.Mapper" class="org.dozer.DozerBeanMapper">
<property name="mappingFiles">
<list>
<value>dozer-global-configuration.xml</value>
<value>dozer-bean-mappings.xml</value>
</list>
</property>
</bean>确保xml文件位于类路径中
http://dozer.sourceforge.net/documentation/springintegration.html
发布于 2011-07-03 22:50:07
正如在the documentation中提到的
可以通过dozer.configuration系统属性指定
替代推土器属性文件。例如,
-Ddozer.configuration=someDozerConfigurationFile.properties
因此,只需使用-Ddozer.configuration=/conf/app/dozer.properties启动您的应用程序
https://stackoverflow.com/questions/6563518
复制相似问题