Change the user's Struts @link(java.util.Locale) based on request
parameters for "language", "country".
After setting the Locale, control is forwarded to an URI path
indicated by a "page" parameter, or a forward indicated by a
"forward" parameter, or to a forward given as the mappings
"parameter" property.
The response location must be specified one of these ways.
String language = request.getParameter(LANGUAGE);
String country = request.getParameter(COUNTRY);
Locale locale = getLocale(request);
if ((!isBlank(language)) && (!isBlank(country))) {
locale = new Locale(language, country);
}
else if (!isBlank(language)) {
locale = new Locale(language, "");
}
HttpSession session = request.getSession();
session.setAttribute(Globals.LOCALE_KEY, locale);
String target = request.getParameter(PAGE);
if (!isBlank(target)) return new ActionForward(target);
target = request.getParameter(FORWARD);
if (isBlank(target)) target = mapping.getParameter();
if (isBlank(target)) {
log.warn(LOCALE_LOG);
return null;
}
return mapping.findForward(target);