http://winmargo.tistory.com/180



리눅스 심볼릭 링크처럼  웹로직에서 가상 디렉토리를 설정해야 할 때 


weblogic - virtual directory mapping 을 이용하여 


weblogic.xml 에 설정하는 방법 입니다.



가상 디렉토리를 설정하고자 하는 url 


http://xxx.xxx.xxx.xxx:7001/Margo/files/bori/cat.jpg

http://xxx.xxx.xxx.xxx:7001/Bori/files/margo/cat.jpg


2개 어플리케이션 context : Margo, Bori 


두개의 어플리케이션에서 공통으로 참조하고, 파일생성 및 삭제를 해야하는 경우 


참조대상 로컬 패스 - c:/webapps/files


프로젝트 Margo 의 weblogic.xml - 어플리케이션마다 WEB-INF 폴더 아래에 위치


<?xml version='1.0' encoding='UTF-8'?>

<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.3/weblogic-web-app.xsd">


<virtual-directory-mapping>

<local-path>C:\webapps</local-path>

<url-pattern>/files/*</url-pattern>

</virtual-directory-mapping>


<context-root>/Margo</context-root>

</weblogic-web-app>




프로젝트 Bori 의 weblogic.xml - 어플리케이션마다 WEB-INF 폴더 아래에 위치


<?xml version='1.0' encoding='UTF-8'?>

<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.3/weblogic-web-app.xsd">


<virtual-directory-mapping>

<local-path>C:\webapps</local-path>

<url-pattern>/files/*</url-pattern>

</virtual-directory-mapping>


<context-root>/Bori</context-root>

</weblogic-web-app>





이렇게 하면 http://xxx.xxx.xxx.xxx:7001/Margo/files/bori/cat.jpg


라고 호출하게되면, c:/webapps/files/bori/cat.jpg 를 참조하게 됩니다.


리눅스 심볼릭 링크처럼 대체하는게 아니고 


지정해준 로컬패스에 이어서 붙게 됩니다.



출처: http://winmargo.tistory.com/180 [보리 & 마고]

출처: http://winmargo.tistory.com/180 [보리 & 마고]



Application의 Weblogic.xml 셋팅



<?xml version = '1.0' encoding = 'UTF-8'?>

<wls:weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                  xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"

                                    xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"

                                                      xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" >


  <wls:context-root>/portlet</wls:context-root>


  <virtual-directory-mapping>

      <local-path>/</local-path>

          <url-pattern>portlet/images/*</url-pattern>

  </virtual-directory-mapping>



</wls:weblogic-web-app>



+ Recent posts