HttpSession userSession = request.getSession(); if (userSession.isNew()) { userSession.setAttribute("userLocale", request.getLocale()); }