File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes message resource  bundle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "message resource  bundle" Watch "message resource  bundle" New topic
Author

message resource bundle

Curtis Vasbinder
Greenhorn

Joined: Mar 26, 2008
Posts: 6
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

Joined: Jan 28, 2003
Posts: 3932
    
  17

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.


Steve
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: message resource bundle
 
Similar Threads
Can I access messages.properties from a groovy class?
how to set different dir to resource bundle file
Properties file path hard coded
.properties vs JNDI
Java property files best practices