1 /** 2 * Licensed under the Artistic License; you may not use this file 3 * except in compliance with the License. 4 * You may obtain a copy of the License at 5 * 6 * http://displaytag.sourceforge.net/license.html 7 * 8 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR 9 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 10 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 11 */ 12 package org.displaytag.localization; 13 14 import java.util.Locale; 15 16 import javax.servlet.http.HttpServletRequest; 17 18 19 /** 20 * Handle the selection of the user locale. By default <code>request.getLocale()</code> is used, but specific 21 * implementations can use different way to determine the locale, for example looking at session variables or cookies. 22 * @author Fabrizio Giustina 23 * @version $Revision: 720 $ ($Author: fgiust $) 24 */ 25 public interface LocaleResolver 26 { 27 28 /** 29 * Returns the Locale choosen for the given request. 30 * @param request HttpServletRequest 31 * @return a valid Locale (<code>null</code> should never be returned) 32 */ 33 Locale resolveLocale(HttpServletRequest request); 34 } 35