Reputation: 244
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?
Upvotes: 3
Views: 10386
Reputation: 145
We can set the root context in 'jboss-web.xml' under WEB-INF directory.
<jboss-web>
<context-root>/</context-root>
</jboss-web>
It will overwrite the welcome-content loading.
Upvotes: 0
Reputation: 244
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.
Upvotes: 6