【发布时间】:2013-05-14 19:25:54
【问题描述】:
这是在运行时获取 java 应用程序当前工作目录的代码。
String currentWorkingDirectory = System.getProperty("user.dir")+System.getProperty("file.separator");
有什么方法可以使用 spring-context xml 进行配置。
例如:
<bean id="csvReportGenerator" class="some.path.CSVReportGenerator">
<constructor-arg name="outputFileName" value="${currentWorkingDirectory}/${reportOutputFileGeneric}"/>
</bean>
【问题讨论】: