摘要: SpringMVC 简介 SpringMVC 也叫 Spring web mvc ,属于表现层的框架。SpringMVC 是 Spring框架的一部分,是在Spring3.0后发布的 第一个SpringMVC 程序 1.导入jar包 2.注册中央调度器 a)<load-on-startup/> 值大 阅读全文
posted @ 2017-08-20 21:17 白日梦想家12138 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 由于自己学习的版本比较落后,这里就不总结了 在我这个版本整合的过程中的几点问题: 1.在web.xml的配置过程中: 2.注:struts2 和 Spring 整合之后,Action 的 生成方式有两种 第一种:<action name="user" class="com.bjsxt.registr 阅读全文
posted @ 2017-08-20 15:53 白日梦想家12138 阅读(115) 评论(0) 推荐(0) 编辑
摘要: HibernateTemplate的使用: 第二种方式: 第三种方式: 阅读全文
posted @ 2017-08-20 15:26 白日梦想家12138 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 使用xml的方式进行声明式的事务管理 推荐使用xml的方式,因为可以同时为多个方法进行声明 阅读全文
posted @ 2017-08-20 15:00 白日梦想家12138 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 声明式的事务管理(AOP的主要用途之一) (Annotation的方式) 1.加入annotation.xsd 2.加入txManager bean 3.<tx:annotation-driven 4.在需要的事务的方法上加 : @Transactional @Transactional 1.被注解 阅读全文
posted @ 2017-08-20 14:35 白日梦想家12138 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Spring 整合 Hibernate 1.Spring指定 database,给下面创建的 SessionFactory用 2.创建 SessionFactory ,然后注入给DAO去使用 3.往DAO中注入SessionFactory 阅读全文
posted @ 2017-08-20 11:42 白日梦想家12138 阅读(111) 评论(0) 推荐(0) 编辑
摘要: xml 配置 AOP 1.将 拦截其器对象 初始化到容器中 2.<aop:config> <aop:aspect.... <aop:pointcut <aop:before 阅读全文
posted @ 2017-08-20 11:23 白日梦想家12138 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 步骤: a)在beans.xml文件中加上对应的xsd文件 spring-aop.xsd b)加上<aop:aspectj-autoproxy>,使用aspectj来完成aop c) 此时就可以解析对应的 Annotation d) 建立我们的拦截类 e) 用 @Aspect 注解这个类 f) 建立 阅读全文
posted @ 2017-08-20 10:45 白日梦想家12138 阅读(786) 评论(0) 推荐(0) 编辑