如果我想在网页中显示图像,并且其 src 是上下文根之外的文件。 在 IDE 中,图像显示为已加载。
但是当我测试网页时,没有任何显示。 如何配置 weblogic 服务器以允许显示图像。如果没有,无论如何都可以解决这个问题。
非常感谢。
最佳答案
您可以使用Virtual Directory Mapping功能(您在 weblogic.xml
中声明的):
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>
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/*
.This directory must be located in the relative uri, such as "/images/test.gif".
关于weblogic - 链接到 weblogic 上下文根外部的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2505078/