首页 > 解决方案 > 将 Wildfly 10 主页替换为包含在 ear 文件中的自定义应用程序

问题描述

我正在尝试用我自己的 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>

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

先感谢您,

塞布

标签: jbossearwildfly-10undertow

解决方案


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

塞布


推荐阅读