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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:39:09+00:00 2026-06-16T15:39:09+00:00

ResourceBundleMessageSource messages are configured in Spring’s configuration file as <bean id=messageSource class=org.springframework.context.support.ResourceBundleMessageSource p:basenames=WEB-INF/strings/appstrings />

  • 0

ResourceBundleMessageSource messages are configured in Spring’s configuration file as

<bean id="messageSource"
  class="org.springframework.context.support.ResourceBundleMessageSource"
  p:basenames="WEB-INF/strings/appstrings" />

Whenever I changed any message in that properties file I have to restart server.

I want to read these updated messages programatically in my application without restarting server.

How can I read these messages programatically in one of my @Controller while running application.

  • 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-16T15:39:10+00:00Added an answer on June 16, 2026 at 3:39 pm

    Define your ResourceBundle property in applicationContext.xml file like:

    <!-- Message Source for appstrings -->
    <bean id="messageSource"
        class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
        <property name="basename" value="WEB-INF/strings/appstrings" />
    
    </bean>
    

    In you Java class/controller auto-wire it as:

    private ReloadableResourceBundleMessageSource messageSource;

      @Autowired
      public void setMessageSource(MessageSource messageSource) {
        this.messageSource = (ReloadableResourceBundleMessageSource) ((DelegatingMessageSource) messageSource).getParentMessageSource();
      }
    

    Then call clearCache() in any function in that class/controller.

    messageSource.clearCache();
    

    I got this exception in controller

    ReloadableResourceBundleMessageSource incompatible with org.springframework.context.support.DelegatingMessageSource
    

    When you try to run it through messageSource in your controller, you get NOTHING, empty string. And if you look closely, you will find that you have a DelegatingMessageSource in your messageSource property, with an empty parent source, which means it is EMPTY, i.e. always returns blank.

    Here’s the solution for this little challenge: move your messageSource definition from spring-servlet.xml to applicationContext.xml!

    Read more..

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

Sidebar

Related Questions

<bean id=messageSource class=org.springframework.context.support.ResourceBundleMessageSource p:basename=messages /> bean and obviously in my velocity files I can
In my application I already use ResourceBundleMessageSource <bean id=messageSource class=org.springframework.context.support.ResourceBundleMessageSource p:basename=i18n/messages /> And all
I don't get this, I have a typical messageSource <bean id=resource class=org.springframework.context.support.ResourceBundleMessageSource> <property name=basenames>
In applicationContext.xml I have defined MessageSource like this: <bean id=messageSource class=org.springframework.context.support.ReloadableResourceBundleMessageSource> <property name=basenames> <list>
org.springframework.context.NoSuchMessageException: No message found under code 'user.username.empty' for locale 'en_GB'. Currently I have the
I have to externalize the Spring MessageSources bundle for i18n support (properties files) outside
What are the different ways to resolve UI messages and provide internalization support in
I am trying to use ResourceBundleMessageSource in Spring. Here is my project structure: And
I suppose that everybody that uses spring, uses form binding and validation. And you
I have some problems using ajax with Spring MVC. I want to refresh only

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.