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

烈酒焚心 提交于 2019-12-07 05:42:29

问题


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


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/1797620/how-can-i-install-one-web-application-in-two-context-roots-in-weblogic-10g

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!