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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:19:38+00:00 2026-05-16T02:19:38+00:00

I started to work in translating a Java program which has tens of dialog

  • 0

I started to work in translating a Java program which has tens of dialog classes to deal with. I wonder how is it possible to create a parameter that is understood in all of those classes, without having to declare it in each one.

Actualy are two parameters. Tried with something like:

public Locale currentLocale = new Locale("en");
public ResourceBundle text = ResourceBundle.getBundle("MessagesBundle", currentLocale);

in the launching class of the program but had no luck.

Any tip?

  • 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-16T02:19:39+00:00Added an answer on May 16, 2026 at 2:19 am

    without having to declare it in each one.

    There are two general approaches:

    1. Singleton pattern.
    2. Store the reference in the thread using ThreadLocal.

    Either way, you need to take a lot of caveats into account. Singletons doesn’t work well in environments with multiple classloaders/JVM’s and ThreadLocals doesn’t work well when you spawn multiple threads yourself to process the business task. You need to understand those caveats very well before continuing.

    The safe approach would be to create the object only once during application’s startup in some front controller class and pass it as argument into the business/model objects whenever needed.

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

Sidebar

Related Questions

I have just started work on asmall program that sends text over net (TON)
An application I have recently started work on has to register two dll's, because
Today I started work on a small Java app. I have some experience with
I've started to work with SOAP and SAML, and when I create an attribute,
I've started work on a simple newtworking project which creates a new thread for
I have recently started work on a project that has already been running for
I have recently started work at a company that has a website. The previous
I've recently started work on a new project using EpiServer which I am totally
I've just started work on an existing .NET application with about 40 active projects.
I just finished the Django tutorial and started work on my own project, however,

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.