Spring AOP请教

09-04-10 along

大家好,有个问题想请教,在用Spring AOP拦截Struts的action时发生一个问题:被代理过的action不能被struts识别,错误信息如下:

2009-04-09 23:36:18,187:org.apache.struts.action.RequestProcessor--Unhandled Exception thrown: class org.springframework.beans.factory.BeanNotOfRequiredTypeException

2009-04-09 23:36:18,203:org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bbs].[action]--Servlet.service() for servlet action threw exception

org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named '/login' must be of type [org.apache.struts.action.Action], but was actually of type [$Proxy1]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:258)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:149)

at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:541)

请大虾们指教~~~~~该怎么办呢?

还有一个问题就是为了拦截action中的execute方法,我的action需要实现一个包含execute方法的接口吗?

[该贴被admin于2009-04-16 09:21修改过]

banq
2009-04-16 09:22

了解一下AOP原理应该明白。