链接到 weblogic 上下文根之外的文件 [英] Link to file outside context root of weblogic
问题描述
如果我想在我的网页中显示一个图像并且它的 src 是上下文根之外的文件.在 IDE 中,图像显示为已加载.
If I want to display an image in my webpage and its src is a file outside context root. At the IDE, the image is shown to be loaded.
但是当我测试网页时,没有显示任何内容.如何配置 weblogic 服务器以允许显示图像.如果没有,无论如何都可以解决这个问题.
But when I test the web page, nothing displayed. How can I config weblogic server to allow the image to be displayed. If not is there anyway to run around this problem.
非常感谢.
推荐答案
您可以使用 虚拟目录映射 功能(您在 weblogic.xml
中声明):
You can use the Virtual Directory Mapping feature (that you declare in the weblogic.xml
):
使用虚拟目录映射功能,您可以创建一个目录提供静态文件,如图像用于多个 Web 应用程序.为了例如,您将创建一个映射类似于以下:
Using the virtual directory mapping feature, you can create one directory to serve static files such as images for multiple Web Applications. For example, you would create a mapping similar to the folowing:
<virtual-directory-mapping>
<local-path>c:/usr/gifs</local-path>
<url-pattern>/images/*</url-pattern>
</virtual-directory-mapping>
请求http://localhost:7001/mywebapp/images/test.gif将导致您的 WebLogic Server执行寻找请求的图像在:c:/usr/gifs/images/*
.
A request to
http://localhost:7001/mywebapp/images/test.gif
will cause your WebLogic Server
implementation to look for the
requested image at:
c:/usr/gifs/images/*
.
此目录必须位于相对uri,例如/images/test.gif".
This directory must be located in the relative uri, such as "/images/test.gif".
这篇关于链接到 weblogic 上下文根之外的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!