">
<struts-config>
<data-sources>
<!-- 配置 db_bus DataSourse -->
<data-source key="db_gongjiaoche" type="org.apache.commons.dbcp.BasicDataSource">
<!—设置driverClassName 以下类似-->
<set-property property="driverClassName" value="org.gjt.mm.mysql.Driver"/>
<set-property property="url" value="jdbc:mysql://localhost:3306/db_bus" />
<set-property property="maxActive" value="100"/>
<set-property property="username" value="root"/>
<set-property property="password" value="123456"/>
<set-property property="autoCommit" value="true"/>
</data-source>
<!-- 配置 db_user DataSourse -->
<data-sourcekey="db_renyuan"type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName" value="org.gjt.mm.mysql.Driver"/>
<set-property property="url" value="jdbc:mysql://localhost:3306/db_user" />
<set-property property="maxActive" value="100"/>
<set-property property="username" value="root"/>
<set-property property="password" value="123456"/>
<set-property property="autoCommit" value="true"/>
</data-source>
</data-sources>
<!—以下为Form表单的配置-->
<form-beans>
<form-bean name="loginform1" type="gongjiaochexitong.renyuan.loginForm"/>
<form-bean name="registform1" type="gongjiaochexitong.renyuan.registForm"/>
<form-bean name="checiform1" type="gongjiaochexitong.gongjiaoche.main_pkg.cheCiForm"/>
<form-bean name="zhandianform1" type="gongjiaochexitong.gongjiaoche.main_pkg.zhanDianForm"/>
<form-bean name="xianluform1" type="gongjiaochexitong.gongjiaoche.main_pkg.xianLuForm"/>
<form-bean name="zhandian_addzhandianform1" type="gongjiaochexitong.gongjiaoche.zhandian_pkg.zhandian_addZhanDianForm"/>
<form-bean name="zhandian_deletezhandianform1" type="gongjiaochexitong.gongjiaoche.zhandian_pkg.zhandian_deleteZhanDianForm"/>
<form-bean name="zhandian_modifyzhandianform1" type="gongjiaochexitong.gongjiaoche.zhandian_pkg.zhandian_modifyZhanDianForm"/>
<form-bean name="checi_insertzhandianform1" type="gongjiaochexitong.gongjiaoche.checi_pkg.checi_insertZhanDianForm"/>
<form-bean name="checi_deletezhandianform1" type="gongjiaochexitong.gongjiaoche.checi_pkg.checi_deleteZhanDianForm"/>
<form-bean name="checi_modifyzhandianform1" type="gongjiaochexitong.gongjiaoche.checi_pkg.checi_modifyZhanDianForm"/>
<form-bean name="checi_addcheciform1" type="gongjiaochexitong.gongjiaoche.checi_pkg.checi_addCheCiForm"/>
<form-bean name="checi_deletecheciform1" type="gongjiaochexitong.gongjiaoche.checi_pkg.checi_deleteCheCiForm"/>
<form-bean name="checi_addcourseform1" type="gongjiaochexitong.gongjiaoche.checi_pkg.checi_addCourseForm"/>
<form-bean name="checi_deletecourseform1" type="gongjiaochexitong.gongjiaoche.checi_pkg.checi_deleteCourseForm"/>
<form-bean name="checi_modifycheciform1" type="gongjiaochexitong.gongjiaoche.checi_pkg.checi_modifyCheCiForm"/>
<form-bean name="checi_showform1" type="gongjiaochexitong.gongjiaoche.checi_pkg.checi_showForm"/>
</form-beans>
<!—所有跳转页面的配置-->
Struts配置文件的相关解释:
(1)form bean标记中的name指定ActionForm的唯一标识和action标记中的name属性是一致的;type属性指定了存放这个ActionForm Bean的路径 。form beans标记中可以指定多个form bean标记。
(2)action标记中的path属性被用于和JSP页面中form标记中的action请求相匹配,例如:此action中的path=”/registerAction” 则对应表单中的action属性值必须为action=” /registerAction.do”;name属性和form bean中的name属性一致;type属性指定了存放这个Action的路径;scope属性指定了这个表单的会话范围是session还是request;input属性允许将action重定向回用以输入表单值的表单。
(3)global-forwards标记用来定义全局转发,forward中的name属性是用来查找该转发的,是唯一标识此全局转发的;path属性指定了存放这个文件的路径。
4.3 公交查询管理系统的实现
4.3.1 视图层的实现
在Struts[11]的MVC设计模式[12]中,公交查询管理系统的视图层主要是JSP页面,在JSP页面中不包含任何的业务逻辑代码,当然视图层还包括对JSP页面中的表单数据进行验证的ActionForm。JSP代码均放于WebRoot目录下。用户注册功能中使用JSP页面开发register.jsp。
视图层涉及到的JSP文件有:register.jsp,successful.jsp。
(1) 用户注册视图层的实现
转贴于 酷文网-论文下载中心 http://www.coolwen.net
共13页: 上一页 [1] [2] [3] [4] [5] 6 [7] [8] [9] [10] [11] [12] [13] 下一页
网摘收藏: