Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Is resource bundle file used often?

 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know resource bundle file is definitely useful for internationalization. But is it a good practice to use it under normal struts application? Seems to me it's easier to just type in the text on the spot instead of having it replaced by resource bundle property file.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most books you read on Struts will recommend as a best practice that you use the Resource Bundle for all literal text. However, you're right: it is a pain in the neck to have to extract every little bit of text you want to use into a properties file. I find myself working on projects where the client has not asked for internationalization, and probably won't any time in the near future. In such a case I normally just put the literal text in the JSP. Should I use the properties file instead? Probably... but then I should floss every day, and I don't do that either.
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree, although it is often recommended in most books that you should externalize all of your strings in the resource bundle, I think it is good that you only do it when it is needed. I have seen some applications before wherein resource bundles have been overused, using them even though internationalization isn't really a requirement. And doesn't using resource bundles increase the overhead, as it stills loads the properties file?
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't floss everyday?!?!

Resource bundles are also handy for keeping the label shown on the screen in sync with the label shown in validation messages. Having all strings in one place can also be handy if you need to change the same word and it appears in several pages (much easier than searching through your JSP files) and to some extent it can help out with spell checking.

- Brent
 
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic