日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区

您的位置:首頁技術文章
文章詳情頁

Spring+SpringMVC+Hibernate整合實例講解

瀏覽:172日期:2023-09-17 08:21:13

使用Maven構建項目,用pom.xml引入相應jar,配置以下文件

創建spring.xml:

<?xml version='1.0' encoding='UTF-8'?><beans xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://www.springframework.org/schema/beans' xmlns:aop='http://www.springframework.org/schema/aop' xmlns:context='http://www.springframework.org/schema/context' xmlns:tx='http://www.springframework.org/schema/tx' xsi:schemaLocation='http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd'> <!-- 整合Hibernate --> <context:property-placeholder location='classpath:db.properties'/> <bean name='dataSource' class='com.mchange.v2.c3p0.ComboPooledDataSource'> <property name='driverClass' value='${jdbc.driver}'/> <property name='jdbcUrl' value='${jdbc.url}'/> <property name='user' value='${jdbc.username}'/> <property name='password' value='${jdbc.password}'/> </bean> <bean name='sessionFactory' class='org.springframework.orm.hibernate5.LocalSessionFactoryBean'> <property name='dataSource' ref='dataSource'/> <property name='configLocation' value='classpath:hibernate.cfg.xml'/> <property name='mappingLocations' value='classpath:mapping/*.hbm.xml'></property> </bean> <bean name='hibernateTransactionManager' class='org.springframework.orm.hibernate5.HibernateTransactionManager'> <property name='sessionFactory' ref='sessionFactory'></property> </bean> <tx:advice transaction-manager='hibernateTransactionManager'></tx:advice> <aop:config> <aop:pointcut expression='execution(* com.forum.service.*.*(..))' /> <aop:advisor advice-ref='txAdvice' pointcut-ref='pointCut'/> </aop:config> <context:component-scan base-package='com.forum'> <context:exclude-filter type='annotation' expression='org.springframework.stereotype.Controller'/> </context:component-scan></beans>

創建springmvc.xml

<?xml version='1.0' encoding='UTF-8'?><beans xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://www.springframework.org/schema/beans' xmlns:aop='http://www.springframework.org/schema/aop' xmlns:context='http://www.springframework.org/schema/context' xmlns:mvc='http://www.springframework.org/schema/mvc' xsi:schemaLocation='http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd'> <!-- 配置MessageConvertor --> <bean class='org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter'> <property name='messageConverters'> <list><bean class='org.springframework.http.converter.json.MappingJackson2HttpMessageConverter'> <property name='supportedMediaTypes'> <list> <value>application/json;charset=utf-8</value> </list> </property></bean> </list> </property> </bean> <!-- 配置模板引擎 --> <bean name='templateResolver' class='org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver'> <property name='prefix' value='/WEB-INF/views/'/> <property name='suffix' value='.html'/> <property name='templateMode' value='HTML'/> <property name='cacheable' value='false'/> <property name='characterEncoding' value='UTF-8'/> </bean> <bean name='templateEngine' class='org.thymeleaf.spring5.SpringTemplateEngine'> <property name='templateResolver' ref='templateResolver'/> </bean> <bean class='org.thymeleaf.spring5.view.ThymeleafViewResolver'> <property name='templateEngine' ref='templateEngine'/> <property name='characterEncoding' value='utf-8'/> </bean> <mvc:annotation-driven></mvc:annotation-driven> <mvc:default-servlet-handler/> <context:component-scan base-package='com.forum'> <context:include-filter type='annotation' expression='org.springframework.stereotype.Controller'/> </context:component-scan></beans>

創建hibernate.cfg.xml

<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE hibernate-configuration PUBLIC '-//Hibernate/Hibernate Configuration DTD 3.0//EN' 'http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd'><hibernate-configuration> <session-factory> <!-- 設置方言 --> <property name='dialect'>org.hibernate.dialect.MySQL5InnoDBDialect</property> <!-- 配置生成SQL的打印 --> <property name='hibernate.show_sql'>true</property> <property name='hibernate.format_sql'>true</property> <!-- 設置自動生成表 --> <property name='hibernate.hbm2ddl.auto'>update</property> <property name='hibernate.connection.isolation'>4</property> </session-factory></hibernate-configuration>

創建db.properties

jdbc.driver=com.mysql.cj.jdbc.Driverjdbc.url=jdbc:mysql://localhost:3306/數據庫名jdbc.username='' #這里自己填寫 jdbc.password='' #這里自己填寫

整合SSH的配置文件已經完成

到此這篇關于Spring+SpringMVC+Hibernate整合實例講解的文章就介紹到這了,更多相關Spring+SpringMVC+Hibernate整合內容請搜索好吧啦網以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持好吧啦網!

標簽: Spring
相關文章:
日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区
鲁大师成人一区二区三区| 亚州av一区| 在线视频亚洲欧美中文| 中文在线а√天堂| 国产精品传媒麻豆hd| 在线精品视频一区| 国产一区观看| 成人自拍av| 麻豆久久一区| 日本精品在线播放| 日韩欧美精品| 欧美国产亚洲精品| 亚洲免费毛片| 日韩制服丝袜先锋影音| 亚洲精品va| 久久精品123| 黄色网一区二区| 国产精品夜夜夜| 日韩高清一区| 日韩一区中文| 亚洲精品中文字幕99999| 三级精品视频| 成人片免费看| 国产精品xx| 国产自产自拍视频在线观看| 欧美日韩在线精品一区二区三区激情综合| 美女毛片一区二区三区四区 | 欧美激情日韩| 国产亚洲一区二区三区不卡| 日韩欧美2区| 日韩精品一区二区三区中文 | 婷婷亚洲五月色综合| 视频小说一区二区| 国产成人精选| 成人小电影网站| 国内精品亚洲| 久久99国产精品视频| 国产精品videossex| 国产欧美三级| 久久不卡国产精品一区二区| 蜜臀av性久久久久蜜臀aⅴ流畅 | 国产二区精品| 亚洲少妇自拍| 国产调教精品| 久久精品99国产精品日本| 国产亚洲电影| 福利一区二区免费视频| 日韩久久电影| 一级欧洲+日本+国产| 黄色亚洲大片免费在线观看| 老牛国产精品一区的观看方式| 老牛国产精品一区的观看方式| 亚洲我射av| 国产欧美日韩视频在线| 色婷婷综合网| 亚洲欧洲日本mm| 午夜久久av| 麻豆精品99| av资源中文在线天堂| 四虎884aa成人精品最新| 国产精品社区| 国产精品久久久久久久久免费高清| 成人精品天堂一区二区三区| 日本aⅴ精品一区二区三区| 国产高清不卡| 日韩精品一区二区三区免费视频| 亚洲va中文在线播放免费| 日本一不卡视频| 亚洲精品一级二级| 国产免费久久| 亚洲欧美不卡| 日韩在线第七页| 国产日本精品| 午夜在线精品| 日韩综合在线| 欧美亚洲三级| 免费成人在线影院| 伊人久久高清| 国产精品欧美大片| 亚洲一区二区三区中文字幕在线观看| 国产麻豆久久| 麻豆国产91在线播放| 少妇精品久久久| 激情欧美亚洲| 91亚洲一区| 国产精品欧美三级在线观看 | 国产一区视频在线观看免费| 国产日韩欧美一区二区三区| 99亚洲视频| 亚洲女同av| 久久99久久久精品欧美| 亚洲最大av| 亚洲视频www| 久久久久国产| 超碰99在线| 美女久久久精品| 日韩不卡一区二区| 蜜桃一区二区三区在线| 国产真实久久| 成人福利av| 精品日韩在线| 国产精品中文字幕制服诱惑| 蜜臀精品一区二区三区在线观看| 国产91久久精品一区二区| 日韩成人精品一区| 精品国产a一区二区三区v免费| 国产亚洲字幕| 欧美日韩精品一区二区三区在线观看| 日韩一区欧美二区| 免费视频久久| 亚洲综合精品四区| 欧美特黄视频| 国模 一区 二区 三区| 日韩另类视频| 久久久精品午夜少妇| 群体交乱之放荡娇妻一区二区| 美女福利一区二区三区| 久久精品女人| 国产精品v亚洲精品v日韩精品| 久久精品 人人爱| 欧美精品影院| 国产精品自在| 国产欧美自拍| 国产精品一区二区三区四区在线观看| 日韩高清一区在线| 国产亚洲精品精品国产亚洲综合| 日韩中文字幕在线一区| 亚洲人妖在线| 日本精品在线播放| 69堂精品视频在线播放| 欧美影院精品| 免费在线欧美黄色| 国产精品久久久久久久久妇女| 麻豆精品久久久| 精品国产日韩欧美精品国产欧美日韩一区二区三区 | 日本电影久久久| 97久久亚洲| 日本不卡视频一二三区| 日韩成人一级| 国产福利一区二区三区在线播放| 久久av导航| 色婷婷综合网| 亚洲精品一区三区三区在线观看| 免费污视频在线一区| 欧美 日韩 国产精品免费观看| 亚洲在线免费| 日韩国产高清在线| 精品国产精品国产偷麻豆| 国产精品不卡| 免费观看不卡av| 久久国产精品毛片| 欧美私人啪啪vps| 久久99精品久久久久久园产越南| 国产一区二区精品久| 精精国产xxxx视频在线野外 | 久久五月天小说| 久久在线视频免费观看| 99精品99| 欧美自拍一区| 免费一区二区三区在线视频| 亚洲精品**中文毛片| 一区二区自拍| 日韩精品免费观看视频| 老色鬼精品视频在线观看播放| 久久精品影视| 免费不卡在线观看| 久久精品毛片| 黄色日韩在线| 国产欧美日韩一级| 久久久久免费av| 日韩亚洲精品在线观看| 麻豆一区在线| 亚洲国产日韩欧美在线| 婷婷综合国产| 久久久久久色 | 亚洲一区二区av| 国产精品久久久久77777丨| 蜜臀久久精品| 亚洲三级视频| 国产精品精品国产一区二区| 久久福利精品| 久久精品女人| 亚洲欧美日韩国产一区二区| 国产精品传媒麻豆hd| av亚洲免费| 日本成人手机在线| 精品久久影院| 玖玖玖国产精品| 精品国产三区在线| 国产精品美女久久久浪潮软件| 国产精品片aa在线观看| 亚洲不卡av不卡一区二区| 日本不卡一区二区| 日韩国产一区二区三区| 亚洲精品女人| 久久国产日本精品| 国产精品a级| 亚洲综合日本| 国产美女高潮在线| 国产亚洲一区二区三区不卡|