net.sourceforge.stripes.integration.spring
Class SpringInterceptor

java.lang.Object
  extended by net.sourceforge.stripes.integration.spring.SpringInterceptor
All Implemented Interfaces:
Interceptor

@Intercepts(value=ActionBeanResolution)
public class SpringInterceptor
extends Object
implements Interceptor

An Interceptor that uses a Spring context to inject Spring beans into newly created ActionBeans immediately following ActionBeanResolution. For more information on how the injection is performed see SpringHelper.injectBeans(Object, net.sourceforge.stripes.action.ActionBeanContext).

To configure the SpringInterceptor for use you will need to add the following to your web.xml (assuming no other interceptors are yet configured):

 <init-param>
     <param-name>Interceptor.Classes</param-name>
     <param-value>
         net.sourceforge.stripes.integration.spring.SpringInterceptor,
         net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor
     </param-value>
 </init-param>
 

If one or more interceptors are already configured in your web.xml simply separate the fully qualified names of the interceptors with commas (additional whitespace is ok).

Since:
Stripes 1.3
Author:
Tim Fennell
See Also:
SpringBean

Constructor Summary
SpringInterceptor()
           
 
Method Summary
 Resolution intercept(ExecutionContext context)
          Allows ActionBean resolution to proceed and then once the ActionBean has been located invokes the SpringHelper to perform Spring based dependency injection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringInterceptor

public SpringInterceptor()
Method Detail

intercept

public Resolution intercept(ExecutionContext context)
                     throws Exception
Allows ActionBean resolution to proceed and then once the ActionBean has been located invokes the SpringHelper to perform Spring based dependency injection.

Specified by:
intercept in interface Interceptor
Parameters:
context - the current execution context
Returns:
the Resolution produced by calling context.proceed()
Throws:
Exception - if the Spring binding process produced unrecoverable errors


? Copyright 2005-2006, Stripes Development Team.