code: public static void setLocale(final HttpServletRequest request, final Locale locale) {
          final HttpSession session = request.getSession(false);
  
          if (null == session) {
              LOGGER.warn("Ignores set locale caused by no session");
  
              return;
          }
  
          session.setAttribute(Keys.LOCALE, locale);
          LOGGER.log(Level.DEBUG, "Client[sessionId={0}] sets locale to [{1}]", new Object[]{session.getId(), locale.toString()});
      }
docs: Sets the specified locale into session of the specified request.
  
  <p>
  If no session of the specified request, do nothing.
  </p>
  
  @param request the specified request
  @param locale  a new locale