本帖最后由 shenshengzhiwen 于 2012-06-01 23:48:32 编辑

解决方案 »

  1.   

    expression="execution(* Impl.QueryYear.querydata*(..))"
    <bean id="queryyears" class="Impl.QueryYear"></bean>bean不是在Impl.QueryYear这个包下吗?Impl.QueryYear.querydata指向的是哪里?
      

  2.   

    用 <aop:pointcut id="testaop" expression="execution(* Impl.QueryYear.querydata(..))" />试试
      

  3.   

    高手都过节去了,
    我来凑个热闹ApplicationContext ctx = new ClassPathXmlApplicationContext("/spring/applicationContext.xml");
    TotalInter greetingService = (TotalInter)ctx
    .getBean("queryyears");// xml资源文件中的classbean的id名称
      

  4.   

    高手不是全都去过节去了,呵呵magong蛮幽默的,多谢magong解决了这个问题,我想问下beanfactory为什么用不了?
      

  5.   

    BeanFactory只提供Spring早期版本的Bean组装特性,差不多是一个向前兼容手段,它对AOP不支持。
    养成习惯直接用ApplicationContext好了。