Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jboss deploying in root context

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?

like image 440
user3260950 Avatar asked Feb 22 '14 16:02

user3260950


People also ask

What is context root Jboss?

The context root of a web application determines which URLs Tomcat will delegate to your web application. If your application's context root is myapp then any request for /myapp or /myapp/* will be handled by your application unless a more specific context root exists.

How do you set root context?

1.1 Right click on the project, select Properties , Web Project Settings , update the context root here. 1.2 Remove your web app from the server and add it back. The context root should be updated. 1.3 If step 2 is failing, delete the server, create a new server and add back the web app.

What is root application context?

The context root for an application defines the location at which the module can be accessed. The context root is part of the URL you use to connect to the application. A URL reference to an IBM® SPSS® Collaboration and Deployment Services application includes the following elements: URL prefix.

How do I set the context root in web xml?

To Set the Context RootA context root must start with a forward slash (/) and end with a string. In a packaged web module for deployment on the GlassFish Server, the context root is stored in glassfish-web. xml.


2 Answers

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>
like image 197
ltalhouarne Avatar answered Sep 29 '22 11:09

ltalhouarne


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:

  • JBoss Web Application Deployment Descriptor

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

  • Deployment Descriptors used In WildFly

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

like image 42
Mark O'Connor Avatar answered Sep 29 '22 11:09

Mark O'Connor