Jboss deploying in root context

2019-02-13 18:15发布

Yes, i know about enable-welcome-root=false, but cant find this in files. Use wildfly final or jboss eap 6.2. Where it is? And why i need to add jboss-web.xml in WEB-INF?

3条回答
别忘想泡老子
2楼-- · 2019-02-13 18:49

The file in question is standalone.xml and is located in the following directory:

%JBOSS_HOME%/configuration/standalone.xml

You need to add enable-welcome-root=false in your virtual server definition in your standalone:

<virtual-server name="localhost" enable-welcome-root="false">

And create a jboss-web.xml file with the following:

<?xml version="1.0" encoding="UTF-8"?>

<jboss-web>
    <context-root>/</context-root>
</jboss-web>
查看更多
smile是对你的礼貌
3楼-- · 2019-02-13 18:57

And building on the answer provided by BelgianMyWaffle.

While J2EE defines the execution environment of a Java app it does not mandate how application servers are configured, so each has their own way to customize behaviour.

The following describes the jboss-web.xml:

The jboss-web.xml is an XML file containing the JBossWeb specific behaviour of a webapp. It replaces the Tomcat context.xml file. You need only to use it if you want properties and behaviour that extent the web.xml of the Servlet 3.0 specifications.

And the following lists all the various mechanisms supported by wildfly for customizing application deployment

JBoss Web deployment descriptor. This can be use to override settings from web.xml, and to set WildFly specific options

查看更多
对你真心纯属浪费
4楼-- · 2019-02-13 18:58

Solution: Clean wildfly server, new clean project, just added jboss-web.xml to WEB-INF. Normal deploying and everything works fine.

查看更多
登录 后发表回答