摘要: package test;import javax.swing.JOptionPane;public class HanNuoTa { private static final String DISK_B = "diskB"; private static final String DISK_A = "diskA"; private static final String DISK_C = "diskC"; static String from = DISK_A; static String to = DISK_C; static S 阅读全文
posted @ 2013-06-21 20:42 ㊣执着㊣ 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 在工程中导入spring支持,导入jar包在spring配置文件中配置dataSource和SessionFactory,将hibernate配置与Spring配置整合在一起(可以删除hibernate.cfg.xml文件);导入数据库源所要使用的Jar包修改所有DAO的hibernate实现,因为Spring中提供了一个HibernateDAOSupport类,可以简化数据库的操作。使用所有DAO类都继承自该类将DAO采用依赖注入的方式注入到Biz中,再将Biz采用依赖注入的方式注入到Action中,在Spring配置文件中做相应配置在web.xml文件中配置监听器以及web应用的初始化参数 阅读全文
posted @ 2013-06-21 20:39 ㊣执着㊣ 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 一 setter方法注入配置文件如下:<bean id="helloAction" class="org.yoo.action.SpringSetterHelloAction"> <!-- setter injection using the nested <ref/> element --> <property name="helloservice"><ref bean="helloService"/></property> <!--可 阅读全文
posted @ 2013-06-21 20:37 ㊣执着㊣ 阅读(488) 评论(0) 推荐(0) 编辑