• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

message resource bundle

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic