使用基于XML方式的切面和切入点的配值的时候提示错误。配置文件内容如下:
<bean id="personService" class="com.service.impl.PersonServiceBean"></bean>
<bean id="myInterceptorForXML" class="com.service.MyInterceptorForXML"></bean><aop:config>
<aop:aspect id="myAOP" ref="myInterceptorForXML">
<aop:pointcut expression="execution (* com.service.impl.PersonServiceBean.*(..))" id="myCut"/>
<aop:before pointcut-ref="myCut" method="doAccessCheck"/>
</aop:aspect>
</aop:config>提示的错误:Pointcut is malformed: error at ::0 formal unbound in pointcut希望各位大侠帮帮忙。谢谢AOP的命名空间和schema也引入了
<bean id="personService" class="com.service.impl.PersonServiceBean"></bean>
<bean id="myInterceptorForXML" class="com.service.MyInterceptorForXML"></bean><aop:config>
<aop:aspect id="myAOP" ref="myInterceptorForXML">
<aop:pointcut expression="execution (* com.service.impl.PersonServiceBean.*(..))" id="myCut"/>
<aop:before pointcut-ref="myCut" method="doAccessCheck"/>
</aop:aspect>
</aop:config>提示的错误:Pointcut is malformed: error at ::0 formal unbound in pointcut希望各位大侠帮帮忙。谢谢AOP的命名空间和schema也引入了
解决方案 »
- 实体类的错误BUG求解答
- MyEclipse 10 连接oracle
- hibernate使用注解获得不到SessionFactory,急!!!!!!
- 不知道标题
- spring AOP 的关注点
- javax.naming.CommunicationException: Receive timed out
- eclipse3.0.1+lomboz+tomcat5.0.28连html文件也报错
- 求助:rss(聚合)是怎么实现的?
- hibernate问题!
- 关于 Exception in thread "main" java.lang.NoClassDefFoundError: org/xml/sax/helpers/DefaultHandler
- 为什么<sx:datetimepicker type="time"/>在ie中 不能用 在firefox可以
- 关于struts2在页面取值的问题
http://blog.csdn.net/llbupt/article/details/6611901
<aop:pointcut expression="execution (* com.service.impl.PersonServiceBean.*(..))" id="myCut"/> <aop:aspect id="myAOP" ref="myInterceptorForXML">
<aop:before pointcut-ref="myCut" method="doAccessCheck"/>
</aop:aspect>
</aop:config>切入点位置注意
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schem...ng-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schem...ng-aop-2.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
你的切面MyInterceptorForXML,doAccessCheck方法有定义参数。而定参数后,
<aop:pointcut expression="execution (* com.service.impl.PersonServiceBean.*(..))" id="myCut"/>
这里也要传参,改成如下形式:expression="execution (* com.service.impl.PersonServiceBean.*(..)) and args()" args()中写入要传入的参数。