package xianpants.support.web.stripes; import net.sourceforge.stripes.action.*; import net.sourceforge.stripes.controller.*; import org.springframework.beans.factory.config.*; import org.springframework.context.*; import org.springframework.web.context.support.*; import javax.servlet.*; @Intercepts(LifecycleStage.ActionBeanResolution) public class SpringInterceptor implements Interceptor { public Resolution intercept(ExecutionContext context) throws Exception { Resolution resolution = context.proceed(); ServletContext servletContext = StripesFilter.getConfiguration().getServletContext(); ApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext); AutowireCapableBeanFactory beanFactory = applicationContext.getAutowireCapableBeanFactory(); beanFactory.autowireBeanProperties(context.getActionBean(), AutowireCapableBeanFactory.AUTOWIRE_NO, false); beanFactory.initializeBean(context.getActionBean(), context.getActionBean().getClass().getSimpleName()); return resolution; } }