如何在 Weblogic 10g 中的两个上下文根中安装一个 Web 应用程序?
如何在 Weblogic 10g 中的两个上下文根中安装一个 Web 应用程序?
How can I install one Web Application in two context roots in Weblogic 10g?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是一个包装问题。将WAR打包两次,每次都有一个特定的
WEB-INF/weblogic.xml
,来解决它。对于第一个 WAR:
对于第二个 WAR:
这将允许您使用标准部署工具。我不建议将您的应用程序安装为共享库。
This is a packaging issue. Package the WAR twice, each with a specific
WEB-INF/weblogic.xml
, to solve it.For the first WAR:
For the second WAR:
This will allow you to use standard deployment tools. I don't recommend installing your application as a shared library.
如果您确实需要这个,我建议您将应用程序设置为共享库,并创建一个新的 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.
假设您在应用程序服务器前面有一个 Apache 反向代理,您可以使用 mod_rewrite 在服务器端动态更改上下文根(对客户端透明)。
例如:将以下指令添加到 httpd.conf 将在客户端调用 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:
Respectivly, you could make the obvious translation to translate the second context root to the other single context root.