Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.interceptor
Class ServletConfigInterceptor

    java.lang.Object
      com.opensymphony.xwork2.interceptor.AbstractInterceptor
          org.apache.struts2.interceptor.ServletConfigInterceptor

All Implemented Interfaces:
  Interceptor, Serializable, StrutsStatics

    public class ServletConfigInterceptor

extends 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:

- `ServletContextAware`
- `ServletRequestAware`
- `ServletResponseAware`
- `ParameterAware`
- `RequestAware`
- `SessionAware`
- `ApplicationAware`
- `PrincipalAware`

Interceptor parameters:

- None

Extending the interceptor:

There are no known extension points for this interceptor.

Example code:

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

See Also:
  `ServletContextAware`, `ServletRequestAware`, `ServletResponseAware`, `ParameterAware`, `SessionAware`, `ApplicationAware`, `PrincipalAware`, Serialized Form

Field Summary
`private static long` | `serialVersionUID`

Fields inherited from interface org.apache.struts2.StrutsStatics
`HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_PORTLET_CONTEXT`

Constructor Summary
`ServletConfigInterceptor()`

Method Summary
`String` | `intercept(ActionInvocation invocation)` Sets action properties based on the interfaces an action implements.

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

### serialVersionUID

    private static final long serialVersionUID

See Also:
  Constant Field Values

Constructor Detail

### ServletConfigInterceptor

    public ServletConfigInterceptor()

Method Detail

### intercept

    public String intercept(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.

  Specified by:
    `intercept` in interface `Interceptor`
  Specified by:
    `intercept` in class `AbstractInterceptor`
  Parameters:
    `invocation` - an encapsulation of the action execution state.
  Returns:
    the return code, either returned from `ActionInvocation.invoke()`, or from the interceptor itself.
  Throws:
    `Exception` - if an error occurs when setting action properties.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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