1 /* 2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 3 * Copyright (C) 2004-2009 Frederico Caldeira Knabben 4 * 5 * == BEGIN LICENSE == 6 * 7 * Licensed under the terms of any of the following licenses at your 8 * choice: 9 * 10 * - GNU General Public License Version 2 or later (the "GPL") 11 * http://www.gnu.org/licenses/gpl.html 12 * 13 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 14 * http://www.gnu.org/licenses/lgpl.html 15 * 16 * - Mozilla Public License Version 1.1 or later (the "MPL") 17 * http://www.mozilla.org/MPL/MPL-1.1.html 18 * 19 * == END LICENSE == 20 */ 21 package net.fckeditor.localization.impl; 22 23 import java.util.Locale; 24 25 import javax.servlet.http.HttpServletRequest; 26 import javax.servlet.jsp.jstl.core.Config; 27 28 import net.fckeditor.localization.LocaleResolver; 29 30 /** 31 * JSTL implementation of the locale resolver. It resolves the locale against 32 * the user session. 33 * 34 * @version $Id: JstlResolver.java 3759 2009-06-22 20:02:26Z mosipov $ 35 */ 36 public class JstlResolver implements LocaleResolver { 37 38 public JstlResolver() { 39 Config.class.hashCode(); 40 } 41 42 public Locale resolveLocale(final HttpServletRequest request) { 43 44 return (Locale) Config.get(request.getSession(), Config.FMT_LOCALE); 45 } 46 47 }