开发者社区 问答 正文

使用Spring实现aop中的测试类代码如何编写?

使用Spring实现aop中的测试类代码如何编写?

展开
收起
去校区学技术 2022-03-31 20:44:30 382 分享 版权
1 条回答
写回答
取消 提交回答
  • public class Test {
    
    public static void main(string[] args){
    
    ApplicationContext ac=new
    
    ClassPathXmlApplicationContext("beans.xml");
    
    UserService userService=
    
    (UserService)ac.getBean("userService");
    
    userService.update(2);
         }
    
    }
    
    2022-03-31 20:49:03
    赞同 展开评论