This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes how to set the locale for display tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to set the locale for display tag" Watch "how to set the locale for display tag" New topic
Author

how to set the locale for display tag

vijay jamadade
Ranch Hand

Joined: May 12, 2008
Posts: 240
Hi ranchers,

In my jsp page, I am setting the locale from the database. It is working fine with other struts 2.0 tags and getting the locale specific message properties file. But display tag is not getting the property value for "titlekey".
Please tell me how to set the locale for display tag manually so that it will use displaytag.properties file according to the locale I have set for.

Now it is taking the browsers locale not the locale that I have set

Please help me as soon as possible


Regards, Vijay Jamadade.
( Nothing is Impossible.)
vijay jamadade
Ranch Hand

Joined: May 12, 2008
Posts: 240
Hey friends,

Finally I have found the solution. I downloaded the source file for i18jstladapter.java from the display tag library source download. The display tag properties file related configurations are specified in this file so it was taking by default the locale from the request. So I changed that methos to set the locale and added that file to my project. I also edited the path for that file in all my displaytag.properties file so that settings for my project will be taken from the file that i have configured.

There is one more way you can use


Thats what it was the thing remains is creating your own locale specific displaytga.properties file and add in your classpath
 
Consider Paul's rocket mass heater.
 
subject: how to set the locale for display tag