org.apache.struts2.interceptor
类 ServletConfigInterceptor

java.lang.Object
  继承者 com.opensymphony.xwork2.interceptor.AbstractInterceptor
      继承者 org.apache.struts2.interceptor.ServletConfigInterceptor
所有已实现的接口:
com.opensymphony.xwork2.interceptor.Interceptor, Serializable, StrutsStatics

public class ServletConfigInterceptor
extends com.opensymphony.xwork2.interceptor.AbstractInterceptor
implements StrutsStatics

An interceptor which sets action properties based on the interfaces an action implements. For example, if the action implements ParameterAware then the action context's parameter map will be set on it.

This interceptor is designed to set all properties an action needs if it's aware of servlet parameters, the servlet context, the session, etc. Interfaces that it supports are:

Interceptor parameters:

Extending the interceptor:

There are no known extension points for this interceptor.

Example code:

 
 <action name="someAction" class="com.examples.SomeAction">
     <interceptor-ref name="servletConfig"/>
     <interceptor-ref name="basicStack"/>
     <result name="success">good_result.ftl</result>
 </action>
 
 

另请参见:
ServletContextAware, ServletRequestAware, ServletResponseAware, ParameterAware, SessionAware, ApplicationAware, PrincipalAware, 序列化表格

字段摘要
 
从接口 org.apache.struts2.StrutsStatics 继承的字段
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION, STRUTS_PORTLET_CONTEXT
 
构造方法摘要
ServletConfigInterceptor()
           
 
方法摘要
 String intercept(com.opensymphony.xwork2.ActionInvocation invocation)
          Sets action properties based on the interfaces an action implements.
 
从类 com.opensymphony.xwork2.interceptor.AbstractInterceptor 继承的方法
destroy, init
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ServletConfigInterceptor

public ServletConfigInterceptor()
方法详细信息

intercept

public String intercept(com.opensymphony.xwork2.ActionInvocation invocation)
                 throws Exception
Sets action properties based on the interfaces an action implements. Things like application properties, parameters, session attributes, etc are set based on the implementing interface.

指定者:
接口 com.opensymphony.xwork2.interceptor.Interceptor 中的 intercept
指定者:
com.opensymphony.xwork2.interceptor.AbstractInterceptor 中的 intercept
参数:
invocation - an encapsulation of the action execution state.
抛出:
Exception - if an error occurs when setting action properties.