Locale and Jsp
843840Nov 12 2009 — edited Nov 12 2009Hi again,
I am new to jsp and would like to hear some expert advice when handling i18n.
A) How are locales working? I have printed out ${pageContext.response.locale}" and ${pageContext.request.locale}" . Should I work with them when handling localization in an application or is there session object or some other way to do it?
B) Which is the most elegant way to handle database entries i18n? For example if there is a field DESCRIPTION in a table TASKS, and I would like to show a translation depending on the user's locale. What I have as an idea is to create fields DESCRIPTION_EN, DESCRIPTION_DE, DESCRIPTION_JP... and read the locale from point A) - from page context or better from session and then call the right query and show the passing version. Does this make sense?
C) As posted earlier the jstl fmt:message works only partly for me. It gets the message from the right bundle but when browser locale is changed it doesn't change to the right bundle. Where could the problem lie?
Thanks