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

  • SEARCH
  • Home
  • 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 8211087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:18:31+00:00 2026-06-07T10:18:31+00:00

There is this tag <terracottaConfig url=host1:9510,host2:9510,host3:9510/> in ehcache.xml file inside spring web application. I

  • 0

There is this tag <terracottaConfig url="host1:9510,host2:9510,host3:9510"/> in ehcache.xml file inside spring web application. I want to externalize url attribute of this tag. Value of URL should be replaced by a property from external file. It will be very helpful if you suggest any solution to this problem.

  • 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-07T10:18:33+00:00Added an answer on June 7, 2026 at 10:18 am

    You can put something like this –
    <terracottaConfig url="${terracotta.config.location}" /> , however the big catch is that this will be loaded only from the system properties. It is not resolved from PropertyPlaceHolder as it is not a Spring configuration file.

    So if you want to use an external config file, you will basically have to programatically set this system property before the Spring Application starts loading up the ehcache.xml file – one way to do that will be write your custom ServletContextListener to load up your properties file and set the system property based on that, this way when the ehcache.xml is loaded up it would be able to resolve the place holder properly.


    Your answer helped me to solve my problem. I just want to add that instead of setting system property through program, I am using util:properties as follows

    <bean id="sysProperties" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
           <property name="targetObject" value="#{@systemProperties}"/>
           <property name="targetMethod" value="putAll"/>
           <property name="arguments">
               <util:properties>
                   <prop key="propertyname_used_in_ecache_xml">#{proerties_defined_using_property_factory['propertyname_defined_in_external_properties_file']}</prop>
               </util:properties>
           </property>
        </bean>
    
        <bean id="cacheManager"
            class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" depends-on="sysProperties">
            <property name="configLocation">
                <value>classpath:ehcache.xml</value>
            </property>
        </bean>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my code...we can find a button tag in this code. There for button
Is there an absolute path while declaring the tag? this will resolve if I
There is this output of objdump on some object file: $ objdump -h main.o
Is there any good reason why the default for this tag would be yes?
I've an XML file like this: <tr class=station> <td class=realtime> <span> 15:11 </span> </td>
in input XML I have a tag <name>Sample '</name> in XSL I transform this
Is there a length limit or maximum size for description tag inside an RSS
There is this way, of course: OuterClass.this . But that's very clumsy. Ideally, there'd
There's this ... MSDN page, IQueryable(Of T) Interface . Can you do a better
there is this check-in-out program here at my workplace, it only takes the data

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.