|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LocalePicker
A LocalePicker is a class that determines what Locale a particular request will use. At first this may seem odd given that the request already has a method called getLocale(), but ask yourself this: if your site only supports English, and the user's browser requests the Japanese locale, in what locale should you accept their input?
The LocalPicker is given access to the request and can use any mechanism it chooses to decide upon a Locale. However, it must return a valid locale. It is suggested that if a locale cannot be chosen that the picker return the system locale.
Method Summary | |
---|---|
String |
pickCharacterEncoding(HttpServletRequest request,
Locale locale)
Picks the character encoding to use for the current request using the specified Locale. |
Locale |
pickLocale(HttpServletRequest request)
Picks a locale for the HttpServletRequest supplied. |
Methods inherited from interface net.sourceforge.stripes.config.ConfigurableComponent |
---|
init |
Method Detail |
---|
Locale pickLocale(HttpServletRequest request)
request
- the current HttpServletRequest
String pickCharacterEncoding(HttpServletRequest request, Locale locale)
request
- the current HttpServletRequestlocale
- the Locale picked by the LocalePicker for this request
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |