Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8014437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:56:04+00:00 2026-06-04T19:56:04+00:00

I cannot figure out how to implement this on my application. I want to

  • 0

I cannot figure out how to implement this on my application.

I want to have an xml (or some file) where the person in charge of the administration of the app chooses where the Root_Dir is.

Right now it is hard-coded something like C:\MyAppRootDir but I want that this path could be modified whenever the admin wants.

Any ideas?

Cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:56:06+00:00Added an answer on June 4, 2026 at 7:56 pm

    There are several ways to provide external configuration to a webapp.

    1. Create a properties file and put it in one of the paths covered by webapp’s runtime classpath, or add its path to the webapp’s runtime classpath.

      E.g. /path/to/config.properties with this content

      xmlrootdir=C:\MyAppRootDir
      

      You’ll be able to grab it by the classloader.

      Properties properties = new Properties();
      properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("config.properties"));
      String xmlrootdir = properties.getProperty("xmlrootdir");
      // ...
      

      Based on your question history, you’re using/targeting Tomcat. The admin could edit the shared.loader entry of its /conf/catalina.properties to point to the folder where this properties file is located.

      shared.loader=/path/to
      
    2. Add a VM argument to Tomcat startup script.

      -Dconfig.xmlrootdir=C:\MyAppRootDir
      

      It’s available as follows:

      String xmlrootdir = System.getProperty("config.xmlrootdir");
      // ...
      
    3. Set an environment variable.

      SET CONFIG_XMLROOTDIR=C:\MyAppRootDir
      

      It’s available as follows:

      String xmlrootdir = System.getenv("CONFIG_XMLROOTDIR");
      // ...
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to implement simple ray tracing algorithm, but I can not figure out
I cannot figure out how to specify default transaction isolation level in Grails application
I cannot figure out why I get this error during check-in. I checked in
I cannot figure out how to convert this code from C# to VB.net. It
I have been trying to implement the camera into my application following this tutorial
I have a particular need which I cannot seem to figure out. I've done
this problem has been bothering me for days and I cannot figure out why
I cannot figure out why this Ajax request is not firing correctly. For simplicity's
I cannot figure out why this is not working. Basically, I am running a
Cannot figure out, where to change EOF in PyCharm. My scripts start with :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.