Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

resource bundles...

Thread view: 
pojo - 22 Feb 2006 15:58 GMT
I want to improve my code using resource bundles. I have fields like
no: of companies
no: of places..etc.,
I want to use resource bundles and put the key value pair like

No: of comapanies = 12
no: of places = 50  ..etc., in a file and use the keys whenever i have
to use the values.

can someone walk me through this...with details like..
what should be the file name for these fields..
where should I put the file name...
what changes hould I make to the config files...etc.,

I am not using struts.
I am using JBoss and Intellij IDEA.

thanks,
Rhino - 22 Feb 2006 16:14 GMT
>I want to improve my code using resource bundles. I have fields like
> no: of companies
[quoted text clipped - 12 lines]
> I am not using struts.
> I am using JBoss and Intellij IDEA.

I'm not sure if you really need to use resource bundles for the data that
you describe; it sounds to me like you'd be fine just using regular
Properties files. Storing your data in Preferences nodes or in a database
may also be good approaches.

However, if you are sure that those other options are inappropriate, I think
you will find that the Internationalization "trail" (chapter) in the Java
Tutorial covers this topic pretty well. You can find it at
http://java.sun.com/docs/books/tutorial/i18n/index.html.

I've only tried using ResourceBundles with applications and applets so I'm
not sure if servlets or JBoss or IDEA add any complications; the exact
placement of the ResourceBundles may differ in those environments. Someone
else may be able to tell you about that.

The tutorial will explain that you can use ResourceBundles to store
information in key-value pairs in both Message and Text bundles; the Text
bundles are the closest to what you want; they are structured just like
Properties files but give you the option of having multiple concurrent
versions of your text in different languages so that your applications can
support multiple languages with minimum of effort.

--
Rhino


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.