【问题标题】:Replace Wildfly 10 homepage with a custom application contained in an ear file将 Wildfly 10 主页替换为包含在 ear 文件中的自定义应用程序
【发布时间】:2019-04-10 01:50:34
【问题描述】:

我正在尝试用我自己的 Web 应用程序之一替换 Wildfly 10 默认主页(从 http://hostname:port 访问)。
我找到了一个很好的方法,方法是删除我的 wildfly 的standalone.xml 的 undertow 子系统的某些部分,并向 default-web-module 添加一个战争。
我的问题是我没有战争,我有一只耳朵(里面有一场战争),但它不能用它。

下面是我的standalone.xml 文件的底层部分:

<subsystem xmlns="urn:jboss:domain:undertow:3.1">
    <buffer-cache name="default"/>
    <server name="default-server">
        <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
        <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
        <host name="default-host" alias="localhost" default-web-module="myear.ear/mywar.war">
            <access-log pattern="%{i,X-Forwarded-For} %h %{i,SM_UNIVERSALID} %t %H %p %U %q %s %D %T" prefix="http-in" suffix=".log"/>
        </host>
    </server>
    <servlet-container name="default">
        <jsp-config/>
        <websockets/>
    </servlet-container>            
    <filters>
        <response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
        <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
    </filters>
</subsystem>

这个解决方案可以用耳朵代替战争吗,还是我必须找到另一种方法?

提前谢谢你,

赛博

【问题讨论】:

  • 您是否尝试仅使用default-web-module="myear.ear" 并在application.xml 中为模块设置&lt;context-root&gt;/&lt;/context-root&gt;
  • 可以,但是没用。

标签: jboss ear wildfly-10 undertow


【解决方案1】:

最后,我通过将WildFly的welcome-content文件夹的index.html页面重定向到我的应用程序解决了这个问题,它更简单,而且效果很好。

赛博

【讨论】:

    猜你喜欢
    • 2021-09-23
    • 2016-06-26
    • 2017-01-21
    • 1970-01-01
    • 2015-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-09
    相关资源
    最近更新 更多