如何在 Weblogic 10g 中的两个上下文根中安装一个 Web 应用程序?

发布于 2024-08-12 02:02:25 字数 47 浏览 2 评论 0原文

如何在 Weblogic 10g 中的两个上下文根中安装一个 Web 应用程序?

How can I install one Web Application in two context roots in Weblogic 10g?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

温柔女人霸气范 2024-08-19 02:02:25

这是一个包装问题。将WAR打包两次,每次都有一个特定的WEB-INF/weblogic.xml,来解决它。
对于第一个 WAR:

<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app>
  <context-root>my-context-1</context-root>
</weblogic-web-app>

对于第二个 WAR:

<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app>
  <context-root>my-context-2</context-root>
</weblogic-web-app>

这将允许您使用标准部署工具。我不建议将您的应用程序安装为共享库。

This is a packaging issue. Package the WAR twice, each with a specific WEB-INF/weblogic.xml, to solve it.
For the first WAR:

<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app>
  <context-root>my-context-1</context-root>
</weblogic-web-app>

For the second WAR:

<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app>
  <context-root>my-context-2</context-root>
</weblogic-web-app>

This will allow you to use standard deployment tools. I don't recommend installing your application as a shared library.

执着的年纪 2024-08-19 02:02:25

如果您确实需要这个,我建议您将应用程序设置为共享库,并创建一个新的 web.xml 文件来更改两个部署的上下文根。

这样您就不会复制整个 war 文件,并且仍然可以单独配置它们。

If you really need this, I recommend making your application a shared library and creating just a new web.xml file to change the context root for the two deployments.

This way you won't duplicate the entire war file and you still can configure them individually.

凉宸 2024-08-19 02:02:25

假设您在应用程序服务器前面有一个 Apache 反向代理,您可以使用 mod_rewrite 在服务器端动态更改上下文根(对客户端透明)。
例如:将以下指令添加到 httpd.conf 将在客户端调用 1.html 时返回 2.html 的内容:


RewriteEngine on
RewriteRule ^/1.html$ /2.html

相应地,您可以进行明显的翻译,将第二个上下文根转换为另一个单个上下文根。

Assuming you have an Apache reverse proxy in front of the app server, you could use mod_rewrite to change the context root on-the-fly on the server side (transparent for the client).
For example: adding the iinstructions below to httpd.conf will return the content of 2.html when the client calls 1.html:


RewriteEngine on
RewriteRule ^/1.html$ /2.html

Respectivly, you could make the obvious translation to translate the second context root to the other single context root.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文