/** * Store the locale to the chosen storage, like f. e. the session * * @param invocation the action invocation * @param locale the locale to store * @param storage the place to store this locale (like Storage.SESSSION.toString()) */ protected Locale storeLocale(ActionInvocation invocation, Locale locale, String storage) { //save it in session Map<String, Object> session = invocation.getInvocationContext().getSession(); if (session != null) { synchronized (session) { if (locale == null) { storage = Storage.NONE.toString(); locale = readStoredLocale(invocation, session); } if (Storage.SESSION.toString().equals(storage)) { session.put(attributeName, locale); } } } return locale; }