3 Replies Latest reply on Apr 14, 2003 10:50 PM by 3004

# virtual directory mapping in weblogic platform 7.0

Hi. I noticed in WebLogic Platform 7.0 there is a entry for
WEB-INF/weblogic.xml that defines a virtual directory. Example:

<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web
Application 7.0//EN"
"http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
<weblogic-web-app>
<virtual-directory-mapping>
<local-path>C:\webapps\context\x\y</local-path>
<url-pattern>/images/*</url-pattern>
</virtual-directory-mapping>
</weblogic-web-app>

In this case I'm assuming that a request of the form
http:/host:7001/context/images/z.gif would map to the physical file
C:\webapps\context\x\y\z.gif. However I cannot get this to work. Is
my assumption about it's use incorrect? Is the syntax of
<local-path/> or <url-pattern/> wrong? Is there something you have to
do to get WebLogic to recognize the weblogin.xml file?

Thanks.
Scott Steimle
Software Engineer
Convera
• ###### 1. Re: virtual directory mapping in weblogic platform 7.0
From the developer

Virtual directories just replace the doc root. The doc root in your case
is C:\webapps\context\x\y. The request uri is /images/Z.gif. So the whole
thing resolves to C:\webapps\context\x\y\images\Z.gif. Which is where the
image should be located.

We have cleared up the docs. Sorry for any inconvenience.

Scott Steimle wrote:
Hi. I noticed in WebLogic Platform 7.0 there is a entry for
WEB-INF/weblogic.xml that defines a virtual directory. Example:

<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web
Application 7.0//EN"
"http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
<weblogic-web-app>
<virtual-directory-mapping>
<local-path>C:\webapps\context\x\y</local-path>
<url-pattern>/images/*</url-pattern>
</virtual-directory-mapping>
</weblogic-web-app>

In this case I'm assuming that a request of the form
http:/host:7001/context/images/z.gif would map to the physical file
C:\webapps\context\x\y\z.gif. However I cannot get this to work. Is
my assumption about it's use incorrect? Is the syntax of
<local-path/> or <url-pattern/> wrong? Is there something you have to
do to get WebLogic to recognize the weblogin.xml file?

Thanks.
Scott Steimle
Software Engineer
Convera
--
Rajesh Mirchandani
Developer Relations Engineer
BEA Support

• ###### 2. Re: virtual directory mapping in weblogic platform 7.0
I see. In my case, x == images, so if I reverse my directory
structure I could still get this to work for me. For instance:

<virtual-directory-mapping>
<local-path>C:\webapps\context\y</local-path>
<url-pattern>/images/*</url-pattern>
</virtual-directory-mapping>

/images/z.gif would map to C:\webapps\context\y\images\z.gif.

I'll have to weigh changing our directory structure vs. keeping the
servlet we have that rewrites the URL.

Scott Steimle.

Rajesh Mirchandani <Reply@ToNewsgroup.Only> wrote in message news:<3D9C788A.9E8F75D0@ToNewsgroup.Only>...
From the developer

Virtual directories just replace the doc root. The doc root in your case
is C:\webapps\context\x\y. The request uri is /images/Z.gif. So the whole
thing resolves to C:\webapps\context\x\y\images\Z.gif. Which is where the
image should be located.

We have cleared up the docs. Sorry for any inconvenience.

Scott Steimle wrote:
Hi. I noticed in WebLogic Platform 7.0 there is a entry for
WEB-INF/weblogic.xml that defines a virtual directory. Example:

<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web
Application 7.0//EN"
"http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
<weblogic-web-app>
<virtual-directory-mapping>
<local-path>C:\webapps\context\x\y</local-path>
<url-pattern>/images/*</url-pattern>
</virtual-directory-mapping>
</weblogic-web-app>

In this case I'm assuming that a request of the form
http:/host:7001/context/images/z.gif would map to the physical file
C:\webapps\context\x\y\z.gif. However I cannot get this to work. Is
my assumption about it's use incorrect? Is the syntax of
<local-path/> or <url-pattern/> wrong? Is there something you have to
do to get WebLogic to recognize the weblogin.xml file?

Thanks.
Scott Steimle
Software Engineer
Convera
• ###### 3. Re: virtual directory mapping in weblogic platform 7.0

To: The tech support engineers,

Could you please update your documentation. I spent some frustrating hours trying
to get this to work.

Thanks
Aashish

From the developer

Virtual directories just replace the doc root. The doc root in your case
is C:\webapps\context\x\y. The request uri is /images/Z.gif. So the whole
thing resolves to C:\webapps\context\x\y\images\Z.gif. Which is where
the
image should be located.

We have cleared up the docs. Sorry for any inconvenience.

Scott Steimle wrote:
Hi. I noticed in WebLogic Platform 7.0 there is a entry for
WEB-INF/weblogic.xml that defines a virtual directory. Example:

<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web
Application 7.0//EN"
"http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
<weblogic-web-app>
<virtual-directory-mapping>
<local-path>C:\webapps\context\x\y</local-path>
<url-pattern>/images/*</url-pattern>
</virtual-directory-mapping>
</weblogic-web-app>

In this case I'm assuming that a request of the form
http:/host:7001/context/images/z.gif would map to the physical file
C:\webapps\context\x\y\z.gif. However I cannot get this to work.
Is
my assumption about it's use incorrect? Is the syntax of
<local-path/> or <url-pattern/> wrong? Is there something you have
to
do to get WebLogic to recognize the weblogin.xml file?