国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發(fā)設(shè)計 > 正文

SSH整合簡述一

2019-11-14 23:43:12
字體:
供稿:網(wǎng)友
SSH整合簡述一1.web.xml中配置
struts2過濾器<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>增加spring上下文配置<context-param><param-name>contextConfigLocation</param-name><param-value>classpath:applicationContext.xml</param-value><context-param>增加監(jiān)聽器<listener><listener-class>org.springframework.web.context.ContextLoaderListener</listerner-class></listener>

2.applicationContext.xml中配置
applicationContext.xml中數(shù)據(jù)源配置 可以換成其它的數(shù)據(jù)源<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">屬性驅(qū)動<property name="driverClassName" value="Oracle.jdbc.driver.OracleDriver"/>連接URL<property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"/>用戶名<property name="username" value="accp"/>密碼<property name="passWord" value="accp"/></bean>配置sessionFactory<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">關(guān)聯(lián)數(shù)據(jù)源<property name="dataSource" ref="dataSource"/>配置hibernate的屬性<property name="hibernateProperties"><props>連接數(shù)據(jù)庫的方言這時視不同的數(shù)據(jù)和版本不同而定<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop></props></property>映射文件配置<property name="mappingResources"><list><value>實現(xiàn)類的hibernate配置文件路徑/類名.hbm.cfg</value><value></value></list></property></bean>

3.struts.xml中配置

在applicationContext.xml中配置struts的action后在struts.xml中action的class要寫applicationContext.xml中配置struts的action的id

以上手打可能有錯,按需求配置


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 恩平市| 衡山县| 江安县| 阿尔山市| 威海市| 宁明县| 额济纳旗| 胶州市| 长宁区| 天祝| 东港市| 石渠县| 安西县| 临朐县| 峡江县| 寻乌县| 峨眉山市| 阜宁县| 卢龙县| 万州区| 霍城县| 志丹县| 镇原县| 兰坪| 礼泉县| 文山县| 南部县| 长汀县| 光泽县| 出国| 临高县| 邻水| 靖西县| 富源县| 通渭县| 巨野县| 满城县| 灵山县| 北宁市| 安吉县| 墨竹工卡县|