spring--day02笔记

发布时间 : 星期日 文章spring--day02笔记更新完毕开始阅读

配置例如: 1.6.4.4 测试

@Test public void demo01(){ String xmlPath = \; ApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlPath); CategoryService categoryService = applicationContext.getBean(\,CategoryService.class); categoryService.addCategory(); categoryService.updateCategory(); } 1.6.4.5 JoinPoint介绍

1.7 aop aspectJ 基于 注解 1.7.1 spring注解

@Service //取代:

@Aspect 用于配置切面 @Before 前置通知

@AfterReturning 后置通知 @Around 环绕前

@AfterThrowing 抛出异常通知 @After 最终

@Pointcut ,将注解类中 切入点共享 共享表达式,添加到一个特殊的方法上,私有,没有返回值,方法名称自定义 使用时,在注解中,当成方法调用。例如:@After(\ @Component //取代:

@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations=\eans.xml\) public class TestApp { @Autowired private OrderService orderService; @Test public void demo01(){ orderService.addOrder(); orderService.updateOrder(); } }

2 JdbcTemplate

? spring 对操作JDBC提供工具类,JdbcTemplate ,jdbc模板。 ? spring对 持久技术的支持

联系合同范文客服:xxxxx#qq.com(#替换为@)