File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSP Pages and i18n Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Pages and i18n" Watch "JSP Pages and i18n" New topic

JSP Pages and i18n

JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Hi all.
Please letme know if this is not the place to post this thread.
My question is not really a technical one but rather an architectural one.
Imagine you develop a web application (J2EE) and you target is spanish and english people.
Are you going to create fully dynamic JSP with all the text in resourceBundle (labels, button names, static text etc..).
Or are you going to create 2 different set of pages in your application, one in english, the other one in spanish where only the data are internationalized in resourcebundles ?

/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
Hi - I do not have a concrete answer.
I have never done anything like that. I think you need a small prototype. I would put together a two or three page site, and code it both ways.
The pages should have same basic functionalities as your real site.
Document *every* thing you do, what results were expected, what were surprises.
You should be able to get a feel for the best way to go in your situation.
HTH, Guy
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Multilingual JSPs are a forte of the Struts application framework - you define the resources in a properties file and use Struts tags to refer to the properties.
For a quick into to Struts, I humbly recommend the article I wrote for the April 2002 Java Pro magazine, which is presently readable online at - please forgive the typo - I consistently referred to the "perform()" method in the Action classes as "process()". Other than that, it should be reliable.
You can find Struts at

An IDE is no substitute for an Intelligent Developer.
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
I think I misexplained my problem.
I know how to put i18n in my application.
Actually, I will (and I already)use Struts for localized messages and contents but the question is:
What is the best practice ?
Is it really interesting to dynamically create all the parts of my page or is it better to have 2 different pages for 2 different languages.
Let's say I have an array with some buttons in my page. Am I going to read the header of the columns from a resourcebundle ? I know I can do it but is it valuable ?
And what about the design problem it can raise.
If the name of my column is 5 characters in english and 20 in spanish, maybe the header will be shorten ?
Same problem with a button name or a label of a sle or a mle.
I am wondering if it could be better to have JSPs in english and another set of JSPs in spanish.
Of course, all dynamic content (data, messages) will ALWAYS be in a resourcebundle and inserted dynamically.
I agree. Here's the link:
subject: JSP Pages and i18n
It's not a secret anymore!