aspose file tools*
The moose likes Java in General and the fly likes ResourceBundle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "ResourceBundle" Watch "ResourceBundle" New topic
Author

ResourceBundle

Marcel de Jong
Ranch Hand

Joined: May 27, 2002
Posts: 54
Hi all,
I'm having a problem with ResourceBundle.
I have some language specific messages to show to the user.
I create the ResourceBundle as follows:

The file is located in the package foo/resource/messages.properties.
However, I want to put the messages.properties file in a separate directory, which are at a higher level then the class files.
My class files are located at classes/foo/../..
I want the messages.properties file located in the directory /properties/
I've tried, I think, almost everything, but I still get the next error.

Anybody an idea how to fix this?
Thanks in advance.
Marcel
[ July 10, 2002: Message edited by: Marcel de Jong ]
Wilfried LAURENT
Ranch Hand

Joined: Jul 13, 2001
Posts: 269
Well if you tell us you have tried almost everything, there is not much left
.
Be sure that the base directory where your resources files lie is mentioned in your CLASSPATH.
W.
Heath Lilley
Ranch Hand

Joined: Jan 09, 2001
Posts: 72
I know that in WebSphere and Visual Age you need to restart the webapp (In VAJ this means u must restart the WTE) inorder for it to find it again.
Somehow it gets cached and cannot be found if you move it with out restarting the webapp. Is the properties/ directory in the classes/ directory? I have never been able to .. my way out of a classpath directory and have the resources found. I think that the classes and resources must be under the classpath directory or sub directory.
Feel free if to let me know if I am wrong.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Try this:

Put the property file 'messages.properties' in the folder 'properties' and add this folder to your CLASSPATH - then it should work.
/Rene


Regards, Rene Larsen
Dropbox Invite
Marcel de Jong
Ranch Hand

Joined: May 27, 2002
Posts: 54
Thanks Rene,
now its working.
i did try something like it before, but I forgot to set the classpath.
Thanks a lot.
Marcel
[ July 11, 2002: Message edited by: Marcel de Jong ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ResourceBundle