![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SSH框架
Z. ZHANG
http://git.oschina.net/zzhao114
展开
-
Spring中@Autowired注解、@Resource注解的区别
Spring不但支持自己定义的@Autowired注解,还支持几个由JSR-250规范定义的注解,它们分别是@Resource、@PostConstruct以及@PreDestroy。@Resource的作用相当于@Autowired,只不过@Autowired按byType自动注入,而@Resource默认按 byName自动注入罢了。@Resource有两个属性是比较重要的转载 2017-02-06 21:38:31 · 322 阅读 · 0 评论 -
Sring的几种注释
Spring 2.5 中除了提供 @Component 注释外,还定义了几个拥有特殊语义的注释,它们分别是:@Repository、@Service 和 @Controller。在目前的 Spring 版本中,这 3 个注释和 @Component 是等效的,但是从注释类的命名上,很容易看出这 3 个注释分别和持久层、业务层和控制层(Web 层)相对应。虽然目前这3 个注释和 @Compo转载 2017-02-07 17:00:01 · 866 阅读 · 0 评论 -
SSH配置
1.struts2中文乱码,在struts.xml中加(package之外) 2.hibernate问题:(1) 中文乱码,在hibernate.cfg.xml中加入jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=gbk(2) 使用flush时同步更新数据库,在hiber原创 2017-01-23 16:08:15 · 622 阅读 · 1 评论 -
Spring的事务隔离与事务传播
Spring 使用注解方式进行事务管理使用步骤:步骤一、在spring配置文件中引入命名空间 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.转载 2017-02-09 23:40:52 · 318 阅读 · 0 评论 -
Spring4+Hibernate4
简介:1.使用注释的方式获取注册bean2.基于是spring的aop,不需要hibernate单独使用的SessionFactory,Spring来管理Session的事务管理,需要在使用session的dao上加@Transactional3.使用此功能来自动扫描注册bean -->Spring配置文件: xmlns:context="http:原创 2017-02-07 18:28:28 · 707 阅读 · 0 评论