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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:53:18+00:00 2026-05-12T09:53:18+00:00

I have a web application that’s based on Spring and the application contexts, applicationContext.xml

  • 0

I have a web application that’s based on Spring and the application contexts, applicationContext.xml and myServlet-servlet.xml contain settings that should be configurable by the sysadmin in deployment.

What’s the best way to enable changing of settings like [database server details, remote webservice endpoints, etc] without requiring editing of the WAR contents?

Spring provides the PropertyPlaceholderConfigurer which can be used in the beans configurations, but I think that’s going to require an absolute path to the properties file, which I’d like to avoid, if for no other reason than to allow multiple instances of the same servlet to run on the same machine.

There’s also maybe the option to use JNDI configured resources, though there doesn’t appear to be a BeanFactoryPostProcessor implementation out-the-box doing this so it might not be a good way to approach it.

What’s the standard best-practice, if there is one, to deal with this sort of requirement?

Related SO entries:

How can I specify system properties in Tomcat configuration on startup?

  • 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-05-12T09:53:18+00:00Added an answer on May 12, 2026 at 9:53 am

    You can also achieve this with a file based solution. On each environment define a environment name system property. Then use this name to load an external properties file. The example below loads a default set that is then overrided with a environment specific set.

    <bean id="propertyPlaceholderConfigurer"
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
        <property name="locations">
                <list>
                        <value>classpath:site/properties/default/placeholder.properties
                        </value>
                        <value>file:///site/properties/${env.name}/placeholder.properties
                        </value>
                </list>
        </property>
    </bean>
    

    Adapted from, my answer here

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

Sidebar

Ask A Question

Stats

  • Questions 212k
  • Answers 212k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer See the DataGridView.CellFormatting Event. This event is called when it's… May 12, 2026 at 10:16 pm
  • Editorial Team
    Editorial Team added an answer Debug -> Windows -> Call Stack (Ctrl + Alt +… May 12, 2026 at 10:16 pm
  • Editorial Team
    Editorial Team added an answer I've ended up creating an xml configuration file for the… May 12, 2026 at 10:16 pm

Related Questions

I have a web application that should behave differently for internal users than external
I have a web application that is becoming rather large. I want to separate
I have a web application that needs to take a file upload from the
I have a web application that's branded according to the user that's currently logged
I have a web application that allows a user to search on some criteria,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.