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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:16:30+00:00 2026-06-13T23:16:30+00:00

We are developing a java web application using Spring MVC with JSON at my

  • 0

We are developing a java web application using Spring MVC with JSON at my presentation layer.
For displaying the UI labels in JSP instead of hard-cording we are getting it from the properties file and in the JSP represent we are using spring:message tag. We are using ResourceBundleMessageSource to achieve this.This is working fine.

But our application will be accessed from various region and based on the region we have different properties file for UI labels which needs to be used. Keys in all the properties file will be same only the value will be diffrent.

For eg: Say there are 2 reqions ‘Region1’ & ‘Region2’ from where the application will be accessed by the user, i have 2 properties file such as message_region1.properties & message_region2.properties. Now when the user log in from Region1 i need to pick message_Region1.properties and if the user log-in from ‘Region2’ i need to pick message_Region2.properties and display the UI labels. Since all the keys in both the properties are same there wont be any changes in my jsp files.

Any advice how to achieve it?

  • 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-13T23:16:31+00:00Added an answer on June 13, 2026 at 11:16 pm

    Simple:)
    Create your message_region1.properties and message_region2.properties files. And Spring picks up the appropriate property file depending on the client’s locale (using Default LocaleResolver). The property files generally are in the format filename_<language>_<country>.properties

    And if you want to tell the Spring, how the locale should be resolved, use one of the 4 approaches given in spring documentation

    EDIT:

    To dynamically change the property file, use one of the below ways; I don’t know if they are better than the 4 approaches (mentioned in above spec).

    1. Just before returning the view, change the locale to the “unique code” of the logged in user, as below.

      RequestContextUtils.getLocale(request).setDefault(new Locale("your code"));
      
    2. Change your message source in spring config to ReloadableResourceBundleMessageSource

      <bean id="messageSource"
       class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
          <property name="basename" value="classpath:messages" />
          <property name="defaultEncoding" value="UTF-8" />
      </bean>
      

      And reset properties file name in controller, before returning the view, as below:

      messageSource.setBasename("classpath:messages" + your code);
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Java Web Application using JSF, Spring and Hibernate. I need
I'm developing bunch of relatively small Spring based java web-application. I'm mostly using annotations
I am developing a web application in java using the Vaadin framework. I am
I'm developing an web application in Java and using facebook account for login to
I am developing a Java EE web application using Struts. The problem is with
I'm developing java enterprise web application using EJB 3.1 and I wonder which technology
I am developing a web application using Spring and Tomcat 7.0. When I test
I am developing an application in Spring Web MVC where i need to execute
I am developing a java web application using hibernate as ORM. Is it possible
I am developing a Java web application using Hibernate and JSF/primefaces. am sometimes getting

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.