Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Why resource bundles

Reply
Thread Tools

Why resource bundles

 
 
enrique
Guest
Posts: n/a
 
      04-17-2007
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

 
Reply With Quote
 
 
 
 
Wojtek
Guest
Posts: n/a
 
      04-17-2007
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.


--
Wojtek


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
resource bundles... pojo Java 1 02-22-2006 04:14 PM
resource bundles with EL syntax ittay.dror@gmail.com Java 0 04-07-2005 01:52 PM
Resource Bundles outside of JARs success_ny@yahoo.com Java 4 03-23-2005 07:12 PM
New custom task to generate Property Resource Bundles (<PRes>) M Series Java 0 10-20-2003 08:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57