Web.xml
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
web-app
version
=
"2.4"
???
xmlns
=
"http://java.sun.com/xml/ns/j2ee"
???
xmlns:xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
???
xsi:schemaLocation
=
"http://java.sun.com/xml/ns/j2ee
???
>
?
<!
—
自動加載一個以
GOpreation
開頭的xml文件
à
???
<
servlet
>
???
??
<
servlet-name
>
GOpreation
</
servlet-name
>
???
??
<
servlet-class
>
org.springframework.web.servlet.DispatcherServlet
</
servlet-class
>
???
??
<
load-on-startup
>
1
</
load-on-startup
>
???
</
servlet
>
???
<
servlet-mapping
>
???????
<
servlet-name
>
GOpreation
</
servlet-name
>
???????
<
url-pattern
>
*.shtml
</
url-pattern
>
???
</
servlet-mapping
>
???
<
jsp-config
>
?
<!
—
注冊spring 標簽-->
??????
<
taglib
>
???????????
<
taglib-uri
>
/spring
</
taglib-uri
>
???????????
<
taglib-location
>
/WEB-INF/spring.tld
</
taglib-location
>
???????
</
taglib
>
??
</
jsp-config
>
?
<!
—
設置
session
有效期-
à
???
<
session-config
>
??
???????
<
session-timeout
>
60
</
session-timeout
>
??
???
</
session-config
>
?
</
web-app
>
?
?
?
GOpreation
-servlet.xml
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<!
DOCTYPE
beans
PUBLIC
"-//SPRING//DTD
BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd"
>
?
<
beans
>
?
<!
—
用class中的類去讀取value中的資源文件-->
???
<
bean
id
=
"propertyConfigurer"
class
=
"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
>
???????
<
property
name
=
"location"
value
=
"/WEB-INF/jdbc.properties"
/>
???
</
bean
>
?
<!
—
定義數據源,該bean的ID為
dataSource
-->
???
<
bean
id
=
"dataSource"
class
=
"org.springframework.jdbc.datasource.DriverManagerDataSource"
>
???????
<
property
name
=
"driverClassName"
value
=
"${jdbc.driverClassName}"
/>
???????
<
property
name
=
"url"
value
=
"${jdbc.url}"
/>
???????
<
property
name
=
"username"
value
=
"${jdbc.username}"
/>
???????
<
property
name
=
"password"
value
=
"${jdbc.password}"
/>
?
???
</
bean
>
?
<!-
定義Hibernate的SessionFactory-
à
???
<
bean
id
=
"sessionFactory"
class
=
"org.springframework.orm.hibernate3.LocalSessionFactoryBean"
>
?
<!
—
依賴注入數據源,注冊的正式上文定義的dataSource-->
???????
<
property
name
=
"dataSource"
ref
=
"dataSource"
/>
?
<!
—
mappingResource
屬性用來列出全部映射文件
—
>
???????
<
property
name
=
"mappingResources"
>
???????????
<
list
>
?
<!
—
以下用來列出所有的PO(Persistent Object持久化對象)映射文件-->
???????????????
<
value
>
gos/hzyg/hdgos/model/Ahouse.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/RinRoomFix.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/MoldBuildList.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/Acompany.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/Soperator.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/RinRepair.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/RbuildFix.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/ClendType.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/Chut.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/AroomLevel.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/CstructType.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/Danalysis.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/RinStuctHouseSum.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/CstructForm.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/MsumTable.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/AroomFix.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/MbuildList.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/RroomFix.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/Cunit.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/CownerType.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/MroomList.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/AroomCheck.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/RinBuildFix.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/RinHouseSum.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/CdamageGrade.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/AbuildLevel.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/Dtproperties.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/AbuildSelfFix.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/AbuildCheck.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/ChouseUse.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/CbuildAge.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/RhouseSumStruct.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/RhouseSum.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/Rrepair.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/Zpara.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/Carea.hbm.xml
</
value
>
???????????????
<
value
>
gos/hzyg/hdgos/model/AbuildSubCheck.hbm.xml
</
value
>
???????????
</
list
>
???????
</
property
>
?
<!-
定義Hibernate的SessionFactory的屬性-
à
?
???????
<
property
name
=
"hibernateProperties"
>
???????????
<
props
>
?
<!
—
指定
hibernate
的連接方言
—
>
???????????????
<
prop
key
=
"hibernate.dialect"
>
${hibernate.dialect}
</
prop
>
?
<!
—
指定是否打印sql語句
—
>
???????????????
<
prop
key
=
"hibernate.show_sql"
>
true
</
prop
>
?
<!
—
待定以后補充
—
>
???????????????
<
prop
key
=
"hibernate.generate_statistics"
>
true
</
prop
>
???????????
</
props
>
???????
</
property
>
???? <
property
name
=
"eventListeners"
>
??????
<
map
>
?????????
<
entry
key
=
"merge"
>
??????????
<
bean
class
=
"org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"
/>
????????
</
entry
>
??????
</
map
>
?????
</
property
>
</
bean
>
???
<
bean
id
=
"viewResolver"
class
=
"org.springframework.web.servlet.view.InternalResourceViewResolver"
>
???????
<
property
name
=
"prefix"
><
value
>
/WEB-INF/view/
</
value
></
property
>
???????
<
property
name
=
"suffix"
><
value
>
.jsp
</
value
></
property
>
???
</
bean
>
???
<!-- urlMapping Space -->
??
???
<
bean
id
=
"urlMapping"
class
=
"org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"
>
???????
<
property
name
=
"mappings"
>
?????????
<
props
>
???????????
<!--
鄧毅TEST
-->
?????????????
<
prop
key
=
"/test.shtml"
>
testController
</
prop
>
???????????
<!--
鄧毅TEST
end -->
???????????
???????????
?
<
prop
key
=
"/seculist.shtml"
>
secuController
</
prop
>
???????????
?
<
prop
key
=
"/chutlist.shtml"
>
chutController
</
prop
>
???????????
?
<
prop
key
=
"/addhouse.shtml"
>
addhouController
</
prop
>
???????????
?
<
prop
key
=
"/inserhouse.shtml"
>
inserhouseController
</
prop
>
???????????
?
<
prop
key
=
"/buildlist.shtml"
>
BuildingListController
</
prop
>
???????????
?
<!--
任喜海 start -->
???????????
?
<
prop
key
=
"/aroomlevellist.shtml"
>
AroomLeveListController
</
prop
>
???????????
?
<!--
任喜海 end -->
???????????
?
?
?????????
</
props
>
???????
</
property
>
???
</
bean
>
<!-- urlMapping Space End-->
?
<!--
*********************************************************? -->
?
<!-- Dao Space -->
???
<!--
鄧毅TEST
-->
???
<
bean
id
=
"testDao"
class
=
"gos.hzyg.hdgos.TEST.TestSql"
>
???????
<
property
name
=
"sessionFactory"
>
???????????
<
ref
local
=
"sessionFactory"
/>
???????
</
property
>
???
</
bean
>
???
<!--?
鄧毅TEST end -->
???
???
<
bean
id
=
"cuDao"
class
=
"gos.hzyg.hdgos.dao.imp.secu.CunitDaoImp"
>
???????
<
property
name
=
"sessionFactory"
>
???????????
<
ref
local
=
"sessionFactory"
/>
???????
</
property
>
???
</
bean
>
???
???
<
bean
id
=
"ahDao"
class
=
"gos.hzyg.hdgos.dao.imp.secu.AhouseDaoImp"
>
???????
<
property
name
=
"sessionFactory"
>
???????????
<
ref
local
=
"sessionFactory"
/>
???????
</
property
>
???
</
bean
>
???
<
bean
id
=
"chDao"
class
=
"gos.hzyg.hdgos.dao.imp.secu.ChutDaoImp"
>
???????
<
property
name
=
"sessionFactory"
>
???????????
<
ref
local
=
"sessionFactory"
/>
???????
</
property
>
???
</
bean
>
???
<
bean
id
=
"csfDao"
class
=
"gos.hzyg.hdgos.dao.imp.secu.CstructFormDaoImp"
>
???????
<
property
name
=
"sessionFactory"
>
???????????
<
ref
local
=
"sessionFactory"
/>
???????
</
property
>
???
</
bean
>
???
<
bean
id
=
"cstDao"
class
=
"gos.hzyg.hdgos.dao.imp.secu.CstructTypeDaoImp"
>
???????
<
property
name
=
"sessionFactory"
>
???????????
<
ref
local
=
"sessionFactory"
/>
???????
</
property
>
???
</
bean
>
???
<
bean
id
=
"cwtDao"
class
=
"gos.hzyg.hdgos.dao.imp.secu.CownerTypeDaoImp"
>
???????
<
property
name
=
"sessionFactory"
>
???????????
<
ref
local
=
"sessionFactory"
/>
???????
</
property
>
???
</
bean
>
???
<
bean
id
=
"cltDao"
class
=
"gos.hzyg.hdgos.dao.imp.secu.ClendTypeDaoImp"
>
???????
<
property
name
=
"sessionFactory"
>
???????????
<
ref
local
=
"sessionFactory"
/>
???????
</
property
>
???
</
bean
>
???
<
bean
id
=
"cbaDao"
class
=
"gos.hzyg.hdgos.dao.imp.secu.CbuildAgeDaoImp"
>
???????
<
property
name
=
"sessionFactory"
>
???????????
<
ref
local
=
"sessionFactory"
/>
???????
</
property
>
???
</
bean
>
???
<
bean
id
=
"AbuildDao"
class
=
"gos.hzyg.hdgos.dao.imp.secu.AbuildDaoImp"
>
???????
<
property
name
=
"sessionFactory"
>
???????????
<
ref
local
=
"sessionFactory"
/>
???????
</
property
>
???
</
bean
>
???
<!-- add by
renxh -->
???
<
bean
id
=
"arDao"
class
=
"gos.hzyg.hdgos.dao.imp.secu.AroomLevelDaoImp"
>
???????
<
property
name
=
"sessionFactory"
>
???????????
<
ref
local
=
"sessionFactory"
/>
???????
</
property
>
???
</
bean
>
???
???
<!-- renxh end
-->
<!-- Dao Space End-->
?
<!--
*********************************************************? -->
?
<!-- Controller Space -->
???
<!--?
鄧毅TEST -->
???
<
bean
id
=
"testController"
class
=
"gos.hzyg.hdgos.TEST.Test"
>
???????
<
property
name
=
"listview"
>
???????????
<
value
>
test
</
value
>
???????
</
property
>
???????
<
property
name
=
"testDao"
>
???????????
<
ref
local
=
"testDao"
/>
???????
</
property
>
???
</
bean
>
?
???
<!--?
鄧毅TEST end -->
???
???
<
bean
id
=
"secuController"
class
=
"gos.hzyg.hdgos.action.secu.SecuListController"
>
???????
<
property
name
=
"listview"
>
???????????
<
value
>
secu/seculist
</
value
>
???????
</
property
>
???????
<
property
name
=
"cuDao"
>
???????????
<
ref
local
=
"cuDao"
/>
???????
</
property
>
???????
<
property
name
=
"ahDao"
>
???????????
<
ref
local
=
"ahDao"
/>
???????
</
property
>
???
</
bean
>
???
<
bean
id
=
"chutController"
class
=
"gos.hzyg.hdgos.action.secu.ChutListController"
>
???????
<
property
name
=
"listview"
>
???
???????
<
value
>
secu/chutlist
</
value
>
???????
</
property
>
???????
<
property
name
=
"chDao"
>
???????????
<
ref
local
=
"chDao"
/>
???????
</
property
>
???
</
bean
>
???
<
bean
id
=
"addhouController"
class
=
"gos.hzyg.hdgos.action.secu.AddhouseController"
>
???
??
<
property
name
=
"listview"
>
???????????
<
value
>
secu/addhouse
</
value
>
???????
</
property
>
???????
<
property
name
=
"csfDao"
>
???????????
<
ref
local
=
"csfDao"
/>
???????
</
property
>
???????
<
property
name
=
"cstDao"
>
???????????
<
ref
local
=
"cstDao"
/>
???????
</
property
>
???????
<
property
name
=
"cwtDao"
>
???????????
<
ref
local
=
"cwtDao"
/>
???????
</
property
>
???????
<
property
name
=
"cltDao"
>
???????????
<
ref
local
=
"cltDao"
/>
???????
</
property
>
???????
<
property
name
=
"cbaDao"
>
???????????
<
ref
local
=
"cbaDao"
/>
???????
</
property
>
???
</
bean
>
???
<
bean
id
=
"inserhouseController"
class
=
"gos.hzyg.hdgos.action.secu.InserhouseController"
>
???????
<
property
name
=
"listview"
>
???????????
<
value
>
secu/addhouse
</
value
>
???????
</
property
>
???
???
<
property
name
=
"ahDao"
>
???????????
<
ref
local
=
"ahDao"
/>
???????
</
property
>
???
</
bean
>
???
<
bean
id
=
"BuildingListController"
class
=
"gos.hzyg.hdgos.action.secu.buildlist.BuildingListController"
>
???????
<
property
name
=
"listview"
>
???????????
<
value
>
secu/buildinglist
</
value
>
???????
</
property
>
???????
<
property
name
=
"ahDao"
>
???????????
<
ref
local
=
"AbuildDao"
/>
???????
</
property
>
???
</
bean
>
???
???
<!-- add by
renxh -->
???
???
<
bean
id
=
"AroomLeveListController"
class
=
"gos.hzyg.hdgos.action.secu.AroomLeveListController"
>
???????
<
property
name
=
"listview"
>
???????????
<
value
>
secu/bungalowws
</
value
>
???????
</
property
>
???????
<
property
name
=
"arDao"
>
???????????
<
ref
local
=
"arDao"
/>
???????
</
property
>
???
???
</
bean
>
???
???
<!-- renxh end
-->
?
?
<!-- Controller Space End -->
?
</
beans
>