使用基于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也引入了
解决方案 »
- hibernate annotation 与struts2问题
- 连接池问题:cannot create jdbc driver of class '' for connect url 'null' no suitable driver
- hibernate hilo 什么时候用
- 用jsp做了快一年网站了,现在有些后怕。关于jsp中的线程安全
- resin2.1.9中实现ssl双向认证疑问
- 请高手帮忙解释一下这几个库是干什么的,谢谢
- TOMCAT的问题
- 初学者所碰到的javamail问题~~~~~~~~
- 关于Application server的问题?
- Dom解析Xml文件根节点问题
- 为什么<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()中写入要传入的参数。