大致错误片段 org.hibernate.HibernateException: No Session found for current thread at org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:97) 大致问题:hibernate在处理sessoin SessionFactory的getCurrentSession并不能保证在没有当前Se
Action想使用serviceImpl时,都需要最原始的方法New一个接口,Service service = new serviceImpl();去实例化service了.都需要Action主动创建对象,将userService实例化. 而加入了Spring后,当Action需要ServiceImpl注入时,需要通过Spring将ServiceImpl实现注入. 由原先的自动创建升级为自动注入.这就是Spring的核心思想控制反转,也称为依赖注入. 原生版applicationContext