public class I18nInterceptor extends I18nInterceptor
This interceptor extends the original xwork i18n interceptor and adds functionality to support cookies.
| Modifier and Type | Class and Description |
|---|---|
protected class |
I18nInterceptor.CookieLocaleFinder |
I18nInterceptor.LocaleFinder, I18nInterceptor.Storage| Modifier and Type | Field and Description |
|---|---|
static String |
COOKIE_STORAGE |
static String |
DEFAULT_COOKIE_ATTRIBUTE |
static String |
DEFAULT_COOKIE_PARAMETER |
protected String |
requestCookieParameterName |
attributeName, DEFAULT_PARAMETER, DEFAULT_REQUESTONLY_PARAMETER, DEFAULT_SESSION_ATTRIBUTE, LOG, parameterName, requestOnlyParameterName| Constructor and Description |
|---|
I18nInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
String |
intercept(ActionInvocation invocation)
Override to handle interception
|
protected Locale |
readStoredLocale(ActionInvocation invocation,
Map<String,Object> session)
Reads the locale from the session, and if not found from the
current invocation (=browser)
|
void |
setRequestCookieParameterName(String requestCookieParameterName) |
protected Locale |
storeLocale(ActionInvocation invocation,
Locale locale,
String storage)
Store the locale to the chosen storage, like f.
|
findLocaleParameter, getLocaleFromParam, readStoredLocalFromCurrentInvocation, readStoredLocalFromSession, saveLocale, setAttributeName, setParameterName, setRequestOnlyParameterNamedestroy, initpublic static final String DEFAULT_COOKIE_ATTRIBUTE
public static final String COOKIE_STORAGE
public static final String DEFAULT_COOKIE_PARAMETER
protected String requestCookieParameterName
public String intercept(ActionInvocation invocation) throws Exception
AbstractInterceptorintercept in interface Interceptorintercept in class I18nInterceptorinvocation - the action invocationActionInvocation.invoke(), or from the interceptor itself.Exception - any system-level error, as defined in Action.execute().protected Locale storeLocale(ActionInvocation invocation, Locale locale, String storage)
I18nInterceptorstoreLocale in class I18nInterceptorinvocation - the action invocationlocale - the locale to storestorage - the place to store this locale (like Storage.SESSSION.toString())protected Locale readStoredLocale(ActionInvocation invocation, Map<String,Object> session)
I18nInterceptorreadStoredLocale in class I18nInterceptorinvocation - the current invocationsession - the current sessionpublic void setRequestCookieParameterName(String requestCookieParameterName)
Copyright © 2000–2016 Apache Software Foundation. All rights reserved.