HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse res = (HttpServletResponse) response;
// create the session if needed
HttpSession session = req.getSession();
Locale currentLocale = (Locale) session.getAttribute(Globals.LOCALE_KEY);
if (currentLocale == null || ignore) {
// create the new locale
Locale locale = new Locale(localeCode);
// reset the Struts locale
session.setAttribute(Globals.LOCALE_KEY, locale);
// reset the JSTL locale
Config.set(session, Config.FMT_LOCALE, locale);
}
chain.doFilter(request, response);