-
mvc框架查看全部
-
用戶邏輯接口實(shí)現(xiàn)類查看全部
-
項(xiàng)目分層查看全部
-
步驟:查看全部
-
public class MyHibernateSessionFactory { private static SessionFactory sessionFactory;//會(huì)話工廠屬性 //構(gòu)造方法私有話,保證單例模式 private MyHibernateSessionFactory() { } //公有的靜態(tài)方法,獲得會(huì)話工廠對(duì)象 public static SessionFactory getSessionFactory() { if(sessionFactory == null) { Configuration config = new Configuration().configure(); ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(config.getProperties()).buildServiceRegistry(); sessionFactory = config.buildServiceFactory(serviceRegistry); return sessionFactory; } else { return sessionFactory; } } }查看全部
-
創(chuàng)建MyHibernateSessionFactory查看全部
-
j查看全部
-
設(shè)置所有Action父類查看全部
-
整合他們兩查看全部
-
兩個(gè)整合查看全部
-
課程簡(jiǎn)介查看全部
-
課程概況查看全部
-
Struts2與hibernate整合 (1)創(chuàng)建struts2和hibernate用戶類庫(kù) (2)導(dǎo)入struts2與hibernate的jar包 (3)配置web.xml (4)創(chuàng)建struts.xml (5)配置hibernate.cfg.xml 1、配置hibernate.cfg.xml文件 <property name="connection.username">root</property> <property name="connection.password"></property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql:///test?useUnicode=true&characterEncoding=UTF-8</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="show_sql">true</property> <property name="format_sql">true</property> <property name="hbm2ddl.auto">update</property> <property name="hibernate.current_session_context_class">thread</property> 2、配置web.xml文件 <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>查看全部
-
123查看全部
-
項(xiàng)目分層: M:實(shí)體層entity,數(shù)據(jù)庫(kù)層db,接口層service,接口實(shí)現(xiàn)層serviceImpl; C:動(dòng)作層Action; V:JSP頁(yè)面。查看全部
舉報(bào)
0/150
提交
取消