Class CookieLocaleHandler
- All Implemented Interfaces:
LocaleHandler
-
Field Summary
Fields inherited from class org.apache.struts2.interceptor.i18n.AbstractLocaleHandler
actionInvocation -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCookieLocaleHandler(ActionInvocation invocation, String requestOnlyParameterName, Set<Locale> supportedLocale, String requestCookieParameterName, String attributeName) -
Method Summary
Modifier and TypeMethodDescriptionfind()Looks for an explicit locale override in request-scoped sources.read(ActionInvocation invocation) Reads locale from persistent/context sources whenLocaleHandler.find()did not resolve one.store(ActionInvocation invocation, Locale locale) Persists the resolved locale when storage is enabled for the current handler.Methods inherited from class org.apache.struts2.interceptor.i18n.AbstractStoredLocaleHandler
findExplicitLocale, findRequestOnlyLocale, normalizeStoredLocaleMethods inherited from class org.apache.struts2.interceptor.i18n.AcceptLanguageLocaleHandler
findAcceptLanguageLocaleMethods inherited from class org.apache.struts2.interceptor.i18n.RequestLocaleHandler
findRequestOnlyParamLocaleMethods inherited from class org.apache.struts2.interceptor.i18n.AbstractLocaleHandler
disableStore, findLocaleParameter, getLocaleFromParam, isLocaleSupported, shouldStore
-
Constructor Details
-
CookieLocaleHandler
-
-
Method Details
-
find
Description copied from interface:LocaleHandlerLooks for an explicit locale override in request-scoped sources.- Specified by:
findin interfaceLocaleHandler- Overrides:
findin classAcceptLanguageLocaleHandler- Returns:
- a locale override or
nullwhen no explicit override is present
-
store
Description copied from interface:LocaleHandlerPersists the resolved locale when storage is enabled for the current handler.- Specified by:
storein interfaceLocaleHandler- Overrides:
storein classRequestLocaleHandler- Parameters:
invocation- current action invocationlocale- locale to store- Returns:
- the effective locale to apply to the invocation context
-
read
Description copied from interface:LocaleHandlerReads locale from persistent/context sources whenLocaleHandler.find()did not resolve one.- Specified by:
readin interfaceLocaleHandler- Overrides:
readin classAcceptLanguageLocaleHandler- Parameters:
invocation- current action invocation- Returns:
- resolved locale or
nullwhen no locale could be resolved
-