@Test
public void testAOP1(){
//启动Spring容器
ApplicationContext ctx = new ClassPathXmlApplicationContext(new String[]{"classpath:applicationContext-mvc.xml","classpath:applicationContext-dataSource.xml"});
//获取service或controller组件
UserController userController = (UserController) ctx.getBean("userController");
userController.testAOP("zhangsan", "123456");
}
数据库数据: