Action getLocale and setLocale into struts
Previous | Home | Next |
Struts 1.3 supports the functionality of retrieving and changing the current locale settings.You can dynamically set the Locale for the user's session. GetLocale() and SetLocale() method are the helper of Action class.
GetLocale():-This methods returns the current selected locale on the client machine.protected Locale getLocale(HttpServletRequest request)SetLocale() :- This is used to sets the locale to the new specified locale.Globals.LOCALE_KEY stores the user's currently selected Locale into their HttpSession scope.protected void setLocale(HttpServletRequest request, Locale locale)Example :- ATM machine,The First thing it often asks you is what language you speak,and press appropriate button.You could do the same thing for your site.
Previous | Home | Next |