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 / April 2007

Tip: Looking for answers? Try searching our database.

Why resource bundles

Thread view: 
enrique - 17 Apr 2007 21:08 GMT
Are there compelling reasons to use resource bundles to store end user-
displayed messages, instead of storing them in Javascript source
files? If I store the messages in resource bundles, do they undergo
any transformations when retrieved?

Thank you.

epp
Wojtek - 17 Apr 2007 21:49 GMT
enrique wrote :
> Are there compelling reasons to use resource bundles to store end user-
> displayed messages, instead of storing them in Javascript source
> files? If I store the messages in resource bundles, do they undergo
> any transformations when retrieved?

This is a question of where the work is done.

With resource bundles the server does the work and the browser displays
the text.

With JavScript, the browser must do the work. I do not believe that
JavaScipt has the equivalent of a HashMap, so the look-up might be
slow.

And the entire JavaScript file will be read, not just the portion for
that page (unless you have many JavaScript files, each for its own
page).

Be aware that most browsers cache JavaScript, and will NOT refresh it
even if the file date/time has changed. You would need to have the user
empty their local cache if the JavaScipt changes, or SHIFT-CLICK on the
refresh page button. IE is especially bad for this, and does not seem
to ever get a newer JavaScript file, at least not during a current
session.

I prefer to have the language files on the server. Once they are loaded
into the application memory, the HashMap look-up is really quite fast.

Signature

Wojtek :-)



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.