国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 乐都县| 安平县| 铜川市| 惠安县| 怀化市| 福清市| 会东县| 自治县| 武鸣县| 玛多县| 商水县| 阜新市| 长沙市| 那坡县| 平武县| 松阳县| 调兵山市| 邵东县| 武清区| 石林| 仁化县| 富裕县| 昌宁县| 阳山县| 和顺县| 东兰县| 綦江县| 蒲江县| 永德县| 丰原市| 洞头县| 崇礼县| 新巴尔虎左旗| 昌乐县| 磐安县| 凭祥市| 美姑县| 汾西县| 绍兴县| 广饶县| 城口县|