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 8863925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:06:39+00:00 2026-06-14T16:06:39+00:00

My web application performs some of its behavior by reading from a properties file.

  • 0

My web application performs some of its behavior by reading from a properties file. I want to have an admin console that can modify the properties file(s) while the application is running through a jsp interface. I can currently read the properties file by doing the following:

Properties props = new Properties();
props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(FILE_PATH));  

I can then pass those to my view and display them.

When I want to modify them though, I’m not able to find the properties file the same way (need an outputstream) to save the new property values, unless I pass a full path to the file.

I’ve read around that it’s bad practice to modify a resource given to you by the ClassLoader. If I was to put the properties file external to the web application, how can I make sure it is locked while the modification are being done? Is there another way to do this (properties have to be in a .properties file).

I’m on Tomcat with Spring MVC if that makes any difference.

  • 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-14T16:06:40+00:00Added an answer on June 14, 2026 at 4:06 pm

    I would keep your current properties file exactly where it is, and use those as the base ‘loading’ source. All overrides would go to a location external to the web app (make the location configurable). Your startup logic would always be:

    • Load base source
    • Overlay overrides

    Quite obviously, whenever a property is changed via the admin console it will be saved as an override. A nice feature of this setup, apart from solving the application archive issue, is that you can then provide the users an option to restore a property value to its ‘default’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple little application that performs some analysis of all our corporate
I have a web application which needs to perform a file copy operation and
I have a web application that uses two databases. DB1 Users perform their CRUD
I have a web application that stores a lot of user generated files. Currently
I would like that my Spring-based web application were able to validate its configuration
I have a Java Swing application. I want to upload information to a web
I have c++ api that its job is connect to some server , this
I have a web application with multiple WARS. These WARS all perform different functions
My web application is written using jsp/javascripts. Backend Java. Have managed to implement the
my web application supposed to send email reminders in some point it will send

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.