Change WildFly 8 welcome-content to use myapplication.war

cbl.adp picture cbl.adp · Jun 8, 2014 · Viewed 9.2k times · Source

When using WildFly 8, pointing a browser at localhost:8080 results in the default welcome-content page being displayed.

I want to change this behaviour so that myapplication.war is displayed instead.

My standalone.xml file currently contains the following default configuration:-

<server name="default-server">
  <http-listener name="default" socket-binding="http"/>
  <host name="default-host" alias="localhost">
    <location name="/" handler="welcome-content"/>
    <filter-ref name="server-header"/>
    <filter-ref name="x-powered-by-header"/>
  </host>
</server>
<handlers>
  <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>

I have found some posts on the JBossDeveloper Forums that suggest the following:-

<host name="default-host" alias="localhost" default-web-module="name-of-your.war">

Just adding the default-web-module parameter doesn't seem to work as the welcome-content page is still displayed.

Removing the location and filter-ref items from the host section stops the welcome-content page being displayed, but results in an HTTP 404 - Not found error.

Can anyone tell me how to resolve this please?

Answer

cbl.adp picture cbl.adp · Jun 8, 2014

Changing the host section to the following and removing the bits described in my original question does in fact work...

<host name="default-host" alias="localhost" default-web-module="name-of-your.war" />

I was getting a 404 - Not found error because of a deployment issue when building the project with NetBeans IDE.

After manually deploying the war file using the WildFly management console, everyting worked just as I wanted.