com.opensymphony.webwork.interceptor
Class ServletConfigInterceptor
java.lang.Object
com.opensymphony.xwork.interceptor.AroundInterceptor
com.opensymphony.webwork.interceptor.ServletConfigInterceptor
- All Implemented Interfaces:
- WebWorkStatics, Interceptor, Serializable
public class ServletConfigInterceptor
- extends AroundInterceptor
- implements WebWorkStatics
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="servlet-config"/>
<interceptor-ref name="basicStack"/>
<result name="success">good_result.ftl</result>
</action>
- Author:
- Patrick Lightbody, Bill Lynch (docs)
- See Also:
ServletContextAware
,
ServletRequestAware
,
ServletResponseAware
,
ParameterAware
,
SessionAware
,
ApplicationAware
,
PrincipalAware
,
Serialized Form
Method Summary |
protected void |
after(ActionInvocation dispatcher,
String result)
Called after the invocation has been executed. |
protected void |
before(ActionInvocation invocation)
Sets action properties based on the interfaces an action implements. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServletConfigInterceptor
public ServletConfigInterceptor()
after
protected void after(ActionInvocation dispatcher,
String result)
throws Exception
- Description copied from class:
AroundInterceptor
- Called after the invocation has been executed.
- Specified by:
after
in class AroundInterceptor
result
- the result value returned by the invocation
- Throws:
Exception
before
protected void before(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:
before
in class AroundInterceptor
- Parameters:
invocation
- an encapsulation of the action execution state.
- Throws:
Exception
- if an error occurs when setting action properties.