ssh框架的项目全纪录(一)

2014-11-24 02:53:00 · 作者: · 浏览: 3

一 整个项目的框架,文件夹分布

二 一些重要的配置文件

2.1 struts.xml

此配置文件主要申明了


然后引入一些

具体的struts配置还是利用上面的引入,分布到具体的模块去些,这里只是一个集合,方便管理。

Xml代码
< xml version="1.0" encoding="UTF-8" >
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">


















































2.2 某个模块的struts配置文件,xxxStruts.xml

在这个配置文件,主要申明了某个模块用哪个Action类来控制和这个控制类处理之后的页面跳转结果页面。由于是利用Spring来管理struts,配置文件里写的处理类名字,其实是在Spring的bean配置文件里面申明好的一个id名字

Xml代码
< xml version="1.0" encoding="UTF-8" >
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">




method="{1}">


/timeout.jsp

/WEB-INF/aerra/aerra_upload_messages.jsp
/WEB-INF/aerra/aerra_upload_messages.jsp

/WEB-INF/report/bank_fee_income_list.jsp
/WEB-INF/report/bank_fee_income_add.jsp
/WEB-INF/report/bank_fee_income_edit.jsp
/WEB-INF/report/ajaxDone.jsp
/WEB-INF/report/ajaxDone.jsp





其中的里面的name="aerra"是模块名, namespace="/"反映在url上就是模块名之前的路径 触发的时候是url/aerra 这样
的 name="aerra_*" 是指只要请求的地址里模块是以aerra_开头的,就进入class="aerraTradeAction"这个类来处理,而这个 erraTradeAction 是由spring管理的,在spring的bean配置文件面进行申明。

2.3 applicationContext.xml

这个配置文件配置了c3p0连接池,注入hibernate的mapping映射文件,注入了各个模块对应的SpringBean配置文件(里面申明了Aciton类和操作数据库接口实现类),还有申明了会话工厂sessionFactory,在接口实现类里面直接用sessionFactory就可以操作数据库相关,比如实例化连接池然后操作数据库之类。

Xml代码
< xml version="1.0" encoding="UTF-8" >
http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">




destroy-method="close">





















class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">






cn/citic/trade/tradetype/bean/TradeType.hbm.xml

cn/citic/trade/user/bean/UserInfo.hbm.xml
cn/citic/trade/merchant/bean/BigMerchantInfo.hbm.xml
cn/citic/trade/merchant/bean/SmallMerchantIn