【发布时间】:2021-02-05 15:53:22
【问题描述】:
正在将应用程序从 ANT (EAR) 迁移到 Maven (WAR)。在 ANT 项目中,我在 WAR 中有 WEB 层,在 JAR 中有 EJB 层。 EJB 模块有 WebService 代码。现在正在将 ANT 迁移到 Maven 从此应用程序将只有 WAR。在 ANT 中应用时,我可以拥有两个不同的上下文根,例如 "/webapp" 和 "/webservice"。在 EJB JAR 归档中定义的上下文根 "/webservice" 如下所示,
<webservices-bnd 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-ws-bnd_1_0.xsd"
version="1.0">
<!-- optional http publishing module overrides -->
<http-publishing context-root="/webservice" />
</webservices-bnd>
所以我有不同的 URL 来访问 WEB 和 WebService, http://localhost:9080/webapp/application/index.html - Webapp http://localhost:9080/webservice/service/helloworld?wsdl - 网络服务
当我只有 WAR 文件时,<http-publishing context-root="/webservice" /> 中的 context-root 将不起作用。所以,我只能使用相同的“webapp”上下文根访问 webapp 和 webservice。 但我需要两个不同的 URL 来访问上面的 webapp 和 webservice。我怎样才能做到这一点?
【问题讨论】:
标签: java maven websphere websphere-liberty