以下是获取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>