How to change the user optional Language in JSP Struts

Aug 25, 2006
Reaction score
hi all,
i am in a problem. i have a application. i want to provide two language (English and Thai)support in the application. i am using struts. i have already done something but it is not working.. let me tell u what i i have done.
i have 2 property file like
i have same key in the both property file but the message is different like
head.detail=Customer Detail
i made the entry in the struts-config.xml for the message resource property file like
<message-resources parameter="" null="false"/>
<message-resources parameter="" null="false"/>

i have a action servlet which change the locale as the user option selected like
for English
<b>myLocale = new Locale("en", ""); </b>
for Thai
<b>myLocale = new Locale("th", "");</b>
as the user click the english or Thai language the myLocate instanciated on that

and the locale get seted into te session like
<b>session.setAttribute(org.apache.struts.Globals.LOCALE_KEY, myLocale);</b>

in JSP i have
<bean:message key="head.detail">
But when ever i am changing the locale by user click the same property file gets load. it does not change the key value for different location. i found that the last enty in the struts config for message property file is getting loaded every time. Can any one help me out from this problem? I hope the problem is clear to you all. I hope to receive your quice reply on that.
Thanks in Advance.

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Latest member

Latest Threads