解决方案 »

  1.   

    例子
    http://codebrane.com/blog/2014/01/23/adding-authentication-to-spring-controller-methods-with-aspectj/
      

  2.   

    你的Spring几个配置文件?注解配置加到mvc的配置文件里了吗?
      

  3.   


    两个配置文件,一个配置spring和hibernate的集成,一个配置springMVC,两个都有写<context:annotation-config>
    <context:conponent-san base-package="包"><aop:aspectj-autoproxy /> 写在第一个里
      

  4.   


    两个配置文件,一个配置spring和hibernate的集成,一个配置springMVC,两个都有写<context:annotation-config>
    <context:conponent-san base-package="包"><aop:aspectj-autoproxy /> 写在第一个里
    包如果包含了所有的类,那你就扫描了两次而且注入了两套,MVC调用的那套Service是没有做事务的,你可以把扫描的包分开,让MVC只扫Controller,或者直接在MVC的配置文件里面做事务配置。
    试试看,也许有用。
      

  5.   

    你这AOP拦截的不是UserController,你拦截spring的类干嘛。先把切入点表达式改掉
      

  6.   

    配置文件写错了… aspectJ那个写在 springMVC 的配置文件里, 我写在了spring的