1 Reply Latest reply on Nov 18, 2015 8:53 AM by Tomaz Cerar

    How to override the <context-root> defined in jboss-web.xml in Wildfly 8.2.x

    Rodrigo Uchoa Novice

      Hi everyone!

       

      Is there a way to override the value defined for the <context-root> element in jboss-web.xml when deploying an application? The problem we´re having is that most of the time only the deployer knows what the context root should be, and making him change this value inside the .war file is at least unconventional. He shouldn't make any changes to the source code in my humble opinion.

       

      Any clues?

       

      Thanks!

        • 1. Re: How to override the <context-root> defined in jboss-web.xml in Wildfly 8.2.x
          Tomaz Cerar Master

          when you deploy your application via CLI / Admin console you can provide different "runtime-name" of the deployment.

          Which than effects the context root.

           

          so myapp.war would be deployed to "/myapp"

          only exception (as defined by servlet spec) for this is ROOT.war that gets deployed to "/"

           

          This works if you don't have context-root set in jboss-web.xml otherwise jboss-web.xml will always win.

           

          if you use deployments folder for deploying your app, you can control this by naming your war differently.