下文提到的是我的方面Spring AOP的错误0:未绑定
@Aspect
public class TestAspect {
@Around("execution (* com.test..*(..))")
public void simonAspect(Joinpoint joinpoint) {
System.out.println(" --- Interceptor --- ");
}
}
和.xml文件是
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
... /schema/aop/spring-aop-3.0.xsd">
<mvc:annotation-driven />
<aop:aspectj-autoproxy />
<context:component-scan base-package="com.test" />
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/view/" />
<property name="suffix" value=".jsp" />
</bean>
<bean class="com.test.aspect.TestAspect" />
</beans>
上部署我收到的异常产生的原因:java.lang.IllegalArgumentException异常:错误的:: 0正式在切入点无约束
我想拦截在com.test包中定义的控制器类的所有方法。
当我使用@component对类进行注释时,错误不会到来,但拦截器也不会被调用。
关于更改这个我是geeting错误导致:java.lang.IllegalArgumentException:警告没有匹配这个类型名称:com.test [Xlint:invalidAbsoluteTypeName] – user2775185