Why resource bundles

Discussion in 'Java' started by enrique, Apr 17, 2007.

  1. enrique

    enrique Guest

    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
     
    enrique, Apr 17, 2007
    #1
    1. Advertising

  2. enrique

    Wojtek Guest

    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 :)
     
    Wojtek, Apr 17, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M Series
    Replies:
    0
    Views:
    358
    M Series
    Oct 20, 2003
  2. Replies:
    4
    Views:
    12,049
  3. Replies:
    0
    Views:
    409
  4. pojo

    resource bundles...

    pojo, Feb 22, 2006, in forum: Java
    Replies:
    1
    Views:
    923
    Rhino
    Feb 22, 2006
  5. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,072
    Smokey Grindel
    Dec 2, 2006
Loading...

Share This Page