SSH框架整合

2021-07-16 09:17:01 字數 1430 閱讀 6476

版本:struts-2.3.30,spring-framework-3.2.10.release,hibernate-distribution-3.6.0.final

一、引入相關jar檔案

二、struts.xml配置

<?xml version="1.0" encoding="utf-8" ?>

"-//apache software foundation//dtd struts configuration 2.3//en"

"">

/index.jsp

這裡只是配置相關action,沒什麼其他;

三、基本的spring一些配置:bean-base.xml

這裡org.springframework.orm.hibernate3.hibernatetransactionmanager有屬性sessionfactory,如果換成其他manager,不一定有sessionfactory屬性,這時候會報bean property ** is not writable or has an invalid setter method類似的錯誤。

四、spring其他的xml檔案配置

這裡以bean-dao.xml為例

<?xml version="1.0" encoding="utf-8"?>

xmlns:xsi="" 

xmlns:p=""

xsi:schemalocation="

/spring-beans-4.3.xsd">

bean-service.xml和bean-action.xml類似。

SSH框架整合

首先將 spring 加入到web容器在 web.xml 中加入 context param param name contextconfiglocation param name 說明 為了管理方便設定了多個 spring 的配置檔案 context param 然後加入 spring liste...

SSH框架整合

記事本手打 正確率略低 1.匯入jar包 name cn.com.product table product name pid column pid class native id name pname column pname property name page column page prop...

SSH框架整合

用的是 myeclipse7.5,spring2.5,hibernate3.2,struts2.0 第一步 新增spring 能力 至少要匯入四個spring 庫 1 spring 2.5 core libraries 2 spring 2.5 persistence core libraries ...