런타임에 Java 응용 프로그램의 현재 작업 디렉토리를 가져 오는 코드입니다.스프링을 사용하여 현재 작업 디렉토리 가져 오기
String currentWorkingDirectory = System.getProperty("user.dir")+System.getProperty("file.separator");
스프링 컨텍스트 xml을 사용하여 구성 할 수있는 방법이 있습니까? 예를 들어
는 :
<bean id="csvReportGenerator" class="some.path.CSVReportGenerator">
<constructor-arg name="outputFileName" value="${currentWorkingDirectory}/${reportOutputFileGeneric}"/>
</bean>
이 도움이 될 http://stackoverflow.com/questions/3965446/how-to-read-system-environment-variable-in-spring-applicationcontext –