File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes The best way to use language files? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic

The best way to use language files?

Dror Astricher
Ranch Hand

Joined: May 20, 2005
Posts: 31
Hi guys,

I'm using Struts and wondered, what is the best way to use language files?

1. Should I put it all in the database and then take it once into a Hashtable that will be saved in Session? Then I can use JSTL to get the variable very easy all over the application.
When the language change, the Hashtable will be loaded with the new language from the database.

2.Should I use text files to store the language variable? and then again once puting it into a hashtable and so on.

3.Can I use a properties file like the ApplicationResource in Struts to store the language variables?

4.Should I just hardcode the variable in different language Hashtables, and then assign the right Hashtable to the Hashtable I use in my Jsp?

Many thanks in advance and have a great day

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Hi Dror,

We have a forum dedicated to Struts.
You should have better luck with this question there.
I'll move it for you.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: The best way to use language files?
It's not a secret anymore!