我需要一点帮助来更改Websphere 8.5应用程序服务器中war的上下文根。当我将其部署到websphere时,我有一个名为test.war的war文件,上下文根是/test,但是我想将其更改为/example
当我在网上查看时,我读到I need to include WEB-INF/ibm-web-ext.xml I test.war,所以我添加了它,并输入以下内容:
<web-ext
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-ext_1_0.xsd"
version="1.0">
<context-root uri="/example"/>
</web-ext>当我再次部署时,上下文根仍然是/test,该文件没有任何效果。我是不是漏掉了什么?
发布于 2014-06-29 20:26:54
安装后,最简单的方法是打开web管理控制台,并通过以下方式更改上下文根:
Applications > Application Types > WebSphere enterprise applications > application_name > Context root for web modules.您也可以通过wsadmin脚本完成此操作。
您可以在应用程序安装期间通过管理控制台提供上下文名称,也可以在安装之前将文件名更改为默认上下文,当您安装war时,文件名取自文件名。
最后一个选项是创建EAR并使用web模块定义application.xml,如下所示:
<web>
<web-uri>test.war</web-uri>
<context-root>example</context-root>
</web>发布于 2014-07-01 08:20:28
“当我再次部署时”
您是否执行了更新或卸载和重新安装?
当您更新应用程序时,WebSphere不一定要更新现有应用程序的绑定(您需要显式地要求WebSphere在更新期间丢弃绑定信息)。您必须在安装过程中选择“使用新绑定”,以便强制WebSphere获取绑定更改。
卸载应用程序时,所有绑定信息都会丢失,因此当您重新安装相同的应用程序时,将使用包含在WAR文件中的绑定信息。
https://stackoverflow.com/questions/24472790
复制相似问题