org.apache.struts2.interceptor
类 I18nInterceptor
java.lang.Object
com.opensymphony.xwork2.interceptor.AbstractInterceptor
com.opensymphony.xwork2.interceptor.I18nInterceptor
org.apache.struts2.interceptor.I18nInterceptor
- 所有已实现的接口:
- com.opensymphony.xwork2.interceptor.Interceptor, Serializable
public class I18nInterceptor
- extends com.opensymphony.xwork2.interceptor.I18nInterceptor
This interceptor extends the original xwork i18n interceptor
and adds functionality to support cookies.
- parameterName (optional) - the name of the HTTP request parameter that dictates the locale to switch to and save
in the session. By default this is request_locale
- requestCookieParameterName (optional) - the name of the HTTP request parameter that dictates the locale to switch to
and save in a cookien. By default this is request_cookie_locale
- requestOnlyParameterName (optional) - the name of the HTTP request parameter that dictates the locale to switch to
for the current request only, without saving it in the session. By default this is request_only_locale
- attributeName (optional) - the name of the session key to store the selected locale. By default this is
WW_TRANS_I18N_LOCALE
<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>
- 另请参见:
- 序列化表格
从类 com.opensymphony.xwork2.interceptor.I18nInterceptor 继承的字段 |
DEFAULT_PARAMETER, DEFAULT_REQUESTONLY_PARAMETER, DEFAULT_SESSION_ATTRIBUTE |
从类 com.opensymphony.xwork2.interceptor.I18nInterceptor 继承的方法 |
setAttributeName, setParameterName, setRequestOnlyParameterName |
从类 com.opensymphony.xwork2.interceptor.AbstractInterceptor 继承的方法 |
destroy, init |
DEFAULT_COOKIE_ATTRIBUTE
public static final String DEFAULT_COOKIE_ATTRIBUTE
- 另请参见:
- 常量字段值
COOKIE_STORAGE
public static final String COOKIE_STORAGE
- 另请参见:
- 常量字段值
DEFAULT_COOKIE_PARAMETER
public static final String DEFAULT_COOKIE_PARAMETER
- 另请参见:
- 常量字段值
I18nInterceptor
public I18nInterceptor()
intercept
public String intercept(com.opensymphony.xwork2.ActionInvocation invocation)
throws Exception
- 指定者:
- 接口
com.opensymphony.xwork2.interceptor.Interceptor
中的 intercept
- 覆盖:
- 类
com.opensymphony.xwork2.interceptor.I18nInterceptor
中的 intercept
- 抛出:
Exception
setRequestCookieParameterName
public void setRequestCookieParameterName(String requestCookieParameterName)