This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

message resource bundle  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we are using message resource bundle and it is called by ResourceBundle bundle = bundleManager.getBundle(basename, context.getViewRoot().getLocale(),Util.getCurrentLoader(this));

The properties files are located outside the jar and to get them loaded, we put the path to them in the classpath property of the Websphere server.

Everything is fine and working, however we no longer are able to put the path to the properties file in the classpath property fo the webspher server.

Is there a way I can pass the location to the loader in my java code?
 
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would need to create a URLClassLoader and pass the path to it.

Altenatively, move the properties files to the applications current classpath. What I have done in the past for production was to package the properties files in a JAR and put a resource manager class inside the same JAR. That way I could easily move the bundle around as needed and use the resource manager's class loader to find the properties. Of course this is good for read-only purposes. In your development system, or when you need the properties to be manipulated, you keep the properties and the resource manager in the same package structure inside your normal classpath.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!