编辑
由于不需要将拦截器声明为Spring bean,因此删除了不必要的部分。感谢@AleksandrM对其进行测试。
就像使用Actions一样,(如果我没记错的话)是在bean.xml中声明的例外,因为Interceptor不会扩展ActionSupport(默认情况下是自动装配的)。
web.xml
<listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class></listener>
ApplicationContext.xml
<bean id="daoServiceBean" />
Struts.xml
<constant name="struts.objectFactory" value="spring" /><package ...> <interceptors>
<interceptor name="myInterceptor" />
MyInterceptor.java
private DaoService daoServiceBean; // Autowired by Spring



