com.interface21.web.servlet
Interface LocaleResolver

All Known Implementing Classes:
CookieLocaleResolver, AcceptHeaderLocaleResolver, SessionLocaleResolver

public interface LocaleResolver

Interface for web-based locale resolution strategies that allows for both locale resolution via the request and locale modification via request and response.

This interface allows for implementations based on request, session, cookies, etc. The default implementation is AcceptHeaderLocaleResolver, simply using the request's locale provided by the respective HTTP header.

Since:
27.02.2003
Author:
Juergen Hoeller
See Also:
AcceptHeaderLocaleResolver

Method Summary
 java.util.Locale resolveLocale(javax.servlet.http.HttpServletRequest request)
          Resolve the current locale via the given request.
 void setLocale(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.Locale locale)
          Set the current locale to the given one.
 

Method Detail

resolveLocale

public java.util.Locale resolveLocale(javax.servlet.http.HttpServletRequest request)
Resolve the current locale via the given request. Should return a default locale as fallback in any case.
Parameters:
request - request to be used for resolution
Returns:
the current locale

setLocale

public void setLocale(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      java.util.Locale locale)
Set the current locale to the given one.
Parameters:
request - request to be used for locale modification
response - response to be used for locale modification
locale - the new locale


Rod Johnson and Spring contributors 2001-2003.