VirtualWebappLoader 或类似的 WebLogic 将目录添加到战争的类路径? [英] VirtualWebappLoader or similar for WebLogic to add directories to war's classpath?
问题描述
如何在部署到 WebLogic 的 war 的类路径上提供外部目录(将在其中部署额外的 jar)?
How can I make an external directory (where additional jars will be deployed) available on the classpath of a war deployed to WebLogic?
我熟悉如何在 Tomcat 上执行此操作,方法是在 context.xml 中定义一个 Loader
元素并包含一个 virtualClasspath
属性,该属性指定 Additional repositories to搜索资源
.
I am familiar with how to do this on Tomcat by defining a Loader
element in the context.xml and including a virtualClasspath
attribute which specifies Additional repositories to search for resources
.
WebLogic 中是否有类似的功能?
Is there a similar feature in WebLogic?
推荐答案
是的,weblogic 也可以选择使用 weblogic.xml 中的 virtual-directory-mapping
执行此操作:
Yes weblogic has the option to do this as well with virtual-directory-mapping
inside weblogic.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">
<virtual-directory-mapping>
<local-path>C:\my\images</local-path>
<url-pattern>*.jpg</url-pattern>
<url-pattern>dir/*</url-pattern>
</virtual-directory-mapping>
</weblogic-web-app>
在战争之外使用 jar 的其他选项包括将 jar 安装为 共享库 或简单地将 jar 文件包含在您的
文件夹中,以使它们可用于所有应用程序.
Other options to use jars outside of a war include installing the jar as a shared library or simply including the jar files inside of your <domain>/lib
folder to make them available to all applications.
这篇关于VirtualWebappLoader 或类似的 WebLogic 将目录添加到战争的类路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!