Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

message resource bundle

 
Curtis Vasbinder
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?
 
Steve Luke
Bartender
Posts: 4181
21
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