使用WildFly 8时,将浏览器指向localhost:8080
会显示默认的welcome-content
页面。
我想更改此行为,以便改为显示myapplication.war
。
我的standalone.xml
文件当前包含以下默认配置:-
<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>
我在JBossDeveloper论坛上找到了一些建议如下的帖子:
<host name="default-host" alias="localhost" default-web-module="name-of-your.war">
仅添加
default-web-module
参数似乎不起作用,因为仍显示welcome-content
页面。从
location
部分中删除filter-ref
和host
项目会停止显示welcome-content
页面,但会导致HTTP 404 - Not found
错误。谁能告诉我如何解决这个问题?
最佳答案
将主机部分更改为以下内容并删除我的原始问题中描述的位实际上是可行的...
<host name="default-host" alias="localhost" default-web-module="name-of-your.war" />
使用NetBeans IDE构建项目时,由于部署问题,出现了
404 - Not found
错误。在使用WildFly管理控制台手动部署了war文件之后,一切都按我的意愿工作了。