org.apache.struts2.interceptor
Class I18nInterceptor

java.lang.Object
  extended by com.opensymphony.xwork2.interceptor.AbstractInterceptor
      extended by com.opensymphony.xwork2.interceptor.I18nInterceptor
          extended by org.apache.struts2.interceptor.I18nInterceptor
All Implemented Interfaces:
Interceptor, Serializable

public class I18nInterceptor
extends I18nInterceptor

This interceptor extends the original xwork i18n interceptor and adds functionality to support cookies.

<interceptor name="i18nCookie" class="org.apache.struts2.interceptor.I18nInterceptor"/> <action name="someAction" class="com.examples.SomeAction"> <interceptor-ref name="i18nCookie"/> <interceptor-ref name="basicStack"/> <result name="success">good_result.ftl</result> </action>

See Also:
Serialized Form

Nested Class Summary
protected  class I18nInterceptor.CookieLocaleFinder
           
 
Nested classes/interfaces inherited from class com.opensymphony.xwork2.interceptor.I18nInterceptor
I18nInterceptor.LocaleFinder, I18nInterceptor.Storage
 
Field Summary
static String COOKIE_STORAGE
           
static String DEFAULT_COOKIE_ATTRIBUTE
           
static String DEFAULT_COOKIE_PARAMETER
           
protected  String requestCookieParameterName
           
 
Fields inherited from class com.opensymphony.xwork2.interceptor.I18nInterceptor
attributeName, DEFAULT_PARAMETER, DEFAULT_REQUESTONLY_PARAMETER, DEFAULT_SESSION_ATTRIBUTE, LOG, parameterName, requestOnlyParameterName
 
Constructor Summary
I18nInterceptor()
           
 
Method Summary
 String intercept(ActionInvocation invocation)
           
protected  Locale readStoredLocale(ActionInvocation invocation, Map<String,Object> session)
           
 void setRequestCookieParameterName(String requestCookieParameterName)
           
protected  Locale storeLocale(ActionInvocation invocation, Locale locale, String storage)
           
 
Methods inherited from class com.opensymphony.xwork2.interceptor.I18nInterceptor
findLocaleParameter, getLocaleFromParam, readStoredLocalFromCurrentInvocation, readStoredLocalFromSession, saveLocale, setAttributeName, setParameterName, setRequestOnlyParameterName
 
Methods inherited from class com.opensymphony.xwork2.interceptor.AbstractInterceptor
destroy, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_COOKIE_ATTRIBUTE

public static final String DEFAULT_COOKIE_ATTRIBUTE
See Also:
Constant Field Values

COOKIE_STORAGE

public static final String COOKIE_STORAGE
See Also:
Constant Field Values

DEFAULT_COOKIE_PARAMETER

public static final String DEFAULT_COOKIE_PARAMETER
See Also:
Constant Field Values

requestCookieParameterName

protected String requestCookieParameterName
Constructor Detail

I18nInterceptor

public I18nInterceptor()
Method Detail

intercept

public String intercept(ActionInvocation invocation)
                 throws Exception
Specified by:
intercept in interface Interceptor
Overrides:
intercept in class I18nInterceptor
Throws:
Exception

storeLocale

protected Locale storeLocale(ActionInvocation invocation,
                             Locale locale,
                             String storage)
Overrides:
storeLocale in class I18nInterceptor

readStoredLocale

protected Locale readStoredLocale(ActionInvocation invocation,
                                  Map<String,Object> session)
Overrides:
readStoredLocale in class I18nInterceptor

setRequestCookieParameterName

public void setRequestCookieParameterName(String requestCookieParameterName)


Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.