2012-04-02 2 views
-1

내가 이클립스에서 웹 어플리케이션을 개발할 때 런타임 workingdir 내 프로젝트이클립스/톰캣 자바 EE Workingdir

c:\workspace\project <-- Workingdir 
c:\workspace\project\WebContent 

의 Basepath하지만 내가 살아있는 유닉스 바람둥이 "의 WebContent"에 배포 할 때 내 작업 디렉토리입니다. 그가 하위 디렉터리를 찾을 때문에

지금 내가 "설정 파일

WebContent\WEB-INF\repository.xml 

이것은 유닉스 바람둥이 작동하지 않습니다이 파일

<bean id="config" class="org.apache.jackrabbit.core.config.RepositoryConfig" factory-method="create"> 
    <constructor-arg index="0" value="WebContent/WEB-INF/repository.xml" /> 
    <constructor-arg index="1" value="JACKRABBITREPOSITORY" /> 
</bean> 

를 가리키는 스프링 빈을 WebContent "이지만 그는 이미이 직위에 있습니다.

내가 할 수있는 방법

c:\workspace\project\WebContent 

일식의 디렉토리 작업, 그래서 모두

답변

0

../WEB-INF/classes/ 디렉토리에 넣어 동일한 경로를 사용하고이 경로가 항상 될 것입니다이로 직접 참조 할 수 있습니다 당신의 classpath에서.

<bean id="config" class="org.apache.jackrabbit.core.config.RepositoryConfig" factory-method="create"> 
    <constructor-arg index="0" value="repository.xml" /> 
    <constructor-arg index="1" value="JACKRABBITREPOSITORY" /> 
</bean> 
당신도 ../WEB-INF/classes/config/repository.xml

<bean id="config" class="org.apache.jackrabbit.core.config.RepositoryConfig" factory-method="create"> 
    <constructor-arg index="0" value="classpath:config/repository.xml" /> 
    <constructor-arg index="1" value="JACKRABBITREPOSITORY" /> 
</bean> 
처럼 "설정"과 같은 이것에 대한 디렉토리를 생성 할 수 있습니다

관련 문제