【SQL开源代码栏目提醒】:网学会员为广大网友收集整理了,基于SSH框架与泛型的通用分页方法设计与实现 - 学士论文,希望对大家有所帮助!
第22卷第1期 计算机技术与发展 V01.22 No.1 2012年1月 COMPUTER TECHNOLOGY AND DEVELOPMENT Jan. 2012 基于SSH框架与泛型的通用分页方法 设计与实现 黄美林,马建华,李 东 (总后勤部后勤科学研究所,北京100071) 摘要:为解决基于J2EE的Web应用中,信息的分页显示存在大量代码重复和实现过于复杂等问题,文中剖析分页处理 过程存在的共性,同时分析目前,“泛用于Web应用开发的开源框架struts、spring、hibernate(简称SSH)进行分析。
通过 SSH框架的整合以及Java泛型技术的应用,文学没计了一种通用的分页方法,并对该方法的实现原型进行设计,同时通过 具体实例对实现过程涉及的通用类、核心属性和方法以及参数配置进行详细描述。
通过在工程项目中的应用,验证了该 方法在降低信息分页处理过程复杂度的同时,提高r分页代码的复用性,同时该方法具有通用高效、简单易用等特点。
关键词:SSH;泛型;通用分页 中图分类号:TP31 文献标识码:A 文章编号:1673—629X(2012)01—0067-05 Design and Implementation of Generic Pagination Means Based on SSH Architecture and Generics HUANG Mei-lin,MA Jian-hua,LI Dong , (Institute of Logistics Sciences,General Logistics Department of PLA,Beijing 100071,China) AbsWaet:To solve the problem that exists in information pagination of J2EE—based Web applications:large code dupl/cation and too compficated tO achieve,analyze the commonness pagination processing and the current widely used open source framework in Web appli· cati∞development struts、spring、hibernate(SSH for short).Through the inmgrafion of SSH and the Java generic technology,designed a universal paging method mad its implementation prototype,while described the OEllllmon class、core attributes and methods parameter con- figuration by meallS of coDcrcte examples in detail.By the project application,this means reduces the pagination complexity of operating information and improves the repetition of pagination code greatly,while it has versatile、efficient and simple features. Key words:SSH;generics;generic pagination0 引 言 过标准信息分页处理实例对该方法的实现步骤和内容 SSH是基于J2EE架构的Web应用中广泛采用的 进行详细描述。
开源框架,同时业务信息的分页显示是各类应用中都需要实现的一个基本功能。
以往的分页处理,通常在 1 SSH框架各个业务逻辑单元中定义分页信息的存储变量,并根 1.1概述据传人参数实现分页处理,将处理结果置于待返回的 SSH框架将基于J2EE的Web应用划分为Web表分页结果存储变量中。
由于分页显示过程大体相似, 现层、业务逻辑层、数据持久层…,通过三层框架的整在所有的业务逻辑单元都进行具体实现的方式造成很 合,有效地改善系统的伸缩性、可维护性、可扩展性及多代码重复,同时以往的分页处理过程在层次划分上 可重用性。
其基本架构图如图l所示嵋1。
蝴国昌匣 昌 匡不够清晰,增加了分页显示实现的复杂性。
为解决上述的
问题,文中在整合SSH框架的同时,应用JDKl.5中新增的泛型技术,设计出一种通用的分页方法,并通 图l