@Test public void should_then_resolve_locale_from_session(){ Config.set(request, Config.FMT_LOCALE, null); JstlLocaleResolver localeResolver = new JstlLocaleResolver(); Locale locale = localeResolver.resolveLocale(request); assertThat(locale).isEqualTo(fr); }
@Override public Locale resolveLocale(HttpServletRequest request) { Object locale = Config.get(request, Config.FMT_LOCALE); if (locale == null) { HttpSession session = request.getSession(false); if (session != null) { locale = Config.get(session, Config.FMT_LOCALE); } } return (locale instanceof Locale ? (Locale) locale : null); }
JstlLocaleResolver implements LocaleResolver { @Override public Locale resolveLocale(HttpServletRequest request) { Object locale = Config.get(request, Config.FMT_LOCALE); if (locale == null) { HttpSession session = request.getSession(false); if (session != null) { locale = Config.get(session, Config.FMT_LOCALE); } } return (locale instanceof Locale ? (Locale) locale : null); } }
JstlLocaleResolver implements LocaleResolver { @Override public Locale resolveLocale(HttpServletRequest request) { Object locale = Config.get(request, Config.FMT_LOCALE); if (locale == null) { HttpSession session = request.getSession(false); if (session != null) { locale = Config.get(session, Config.FMT_LOCALE); } } return (locale instanceof Locale ? (Locale) locale : null); }  }
JstlLocaleResolver implements LocaleResolver { @Override public Locale resolveLocale(HttpServletRequest request) { Object locale = Config.get(request, Config.FMT_LOCALE); if (locale == null) { HttpSession session = request.getSession(false); if (session != null) { locale = Config.get(session, Config.FMT_LOCALE); } } return (locale instanceof Locale ? (Locale) locale : null); }  @Override Locale resolveLocale(HttpServletRequest request); }
JstlLocaleResolver implements LocaleResolver { @Override public Locale resolveLocale(HttpServletRequest request) { Object locale = Config.get(request, Config.FMT_LOCALE); if (locale == null) { HttpSession session = request.getSession(false); if (session != null) { locale = Config.get(session, Config.FMT_LOCALE); } } return (locale instanceof Locale ? (Locale) locale : null); }  @Override Locale resolveLocale(HttpServletRequest request);  }