【发布时间】:2013-02-15 23:45:50
【问题描述】:
我正在使用注解来指示需要将建议应用于方法。
我在一个名为IMaintenanceDAOSupport的接口中有这两种方法
@AuditLogging
void insert(M domainobject, IntResponse response, String statementName);
@AuditLogging
int delete(M domainobject, IntResponse response, String statementName);
我们如何为要应用的切面配置xml?
目前有
<aop:config>
<aop:aspect ref="auditAOP">
<aop:pointcut id="im-insert"
expression="within(IMaintenanceDAOSupport)and execution(@annotation(AuditLogging))"/>
<aop:after method="afterInsertUpdateOrDelete" pointcut-ref="im-insert"/>
</aop:aspect>
</aop:config>
编译错误;您看到配置中有什么错误吗?
【问题讨论】:
-
“出现编译错误”你看到了什么错误?
-
java.lang.IllegalArgumentException:切入点格式不正确:在字符位置 139 处需要“名称模式”
标签: java annotations aop spring-aop pointcut