JSF框架在J2EE Web应用中的研究与实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
近年来,随着网络技术的迅速发展,基于B/S模式的Web应用系统成为主流。J2EE具有可移植性、可扩展性和跨平台特性,成为开发B/S模式Web应用的标准平台。基于J2EE的Web应用系统开发分为业务逻辑开发和表示逻辑的开发。业务逻辑的开发可以通过编写JavaBean来实现。表示逻辑的开发一直是J2EE Web应用开发的难点。由于J2EE平台没有提供可重用的UI组件和统一的表示层开发框架,表示层的开发主要是通过编写JSP/Servlet和JavaScript来实现,这是一件相当费时的工作,而且代码很难重用和维护,同时程序的调试也很困难。
     针对上述问题,论文结合表示层开发的现状,采用基于框架的软件开发方式,以实现MVC(Model-View-Controller的简写,即模型-视图-控制器)设计模式的JSF框架作为系统开发的核心框架。MVC设计模式是目前开发Web应用系统非常流行的设计模式,它将系统的表示逻辑与业务逻辑分离,提高了系统的可维护性和可重用性。JSF框架是一种基于UI组件的服务器端应用框架,利用JSF框架提供的丰富UI组件(这些组件中还封装了事件处理、转换与验证等操作)进行表示层的开发,大大提高了系统的开发效率。文中对JSF框架的组成结构、核心组件、工作流程以及JSF的标准请求处理生命周期进行了深入研究,并与目前十分流行的Struts框架进行了比较。
     论文以泸州北方计划管理系统作为理论与实践的结合,详细分析了JSF框架在该项目中的应用。根据系统开发的实际需要对JSF框架进行了扩展,针对JSF框架验证模型的不足提出了解决方案。AJAX技术是最近出现的一种客户端技术,通过使用这种技术可以弥补JSF框架在客户端应用的弱点。因此,在系统开发中引入了基于AJAX技术的客户端框架AJAX4JSF。通过AJAX4JSF框架的引入,能够一定程度上减轻服务器端的负载,提高系统对用户的响应速度。通过实践表明,应用改进后的JSF框架进行系统开发可以提高软件性能和开发效率,同时满足系统扩展性和可维护性的要求。
In recent years, with the rapid development of network technology, Web application system based on B/S architecture become more and more important. The Java 2 Enterprise Edition (J2EE) platform has the transportability and expansibility and has gradually become a standard platform of developing Web application based on B/S architecture. It's purpose is to lighten the burden of building enterprise Web application completely. Development of Web application based on J2EE can divide into development of presentation logic and development of business logic. Development of business logic can build through JavaBean. Development of presentation logic is difficult for developing Web application based on J2EE. Because the J2EE platform doesn't provide reusable UI component and presentation layer framework, the realization of presentation layer is completed by programming JSP/Servlet and JavaScript. It's an extremely time-consuming work, moreever the code is difficult to reuse and debug.
     Aimed at the above problems, the thesis uses the development method based on framework. JSF (JavaServer Faces) is the server-side's application framework based on UI component which implements MVC (Model-View-Controller). It's a new technology propagandized by Sun Microsystes and it aims at providing a standard framework to develop user interfaces of Web application. MVC design pattern separates presentation layer and business layer. UI components of JSF are binded by event, converter and validator and can response to events created by client-side. It can improve the efficiency of program development by using UI components of JSF. The thesis studied the structure, the implement principal, the core parts and the standar life-cycle of JSF. JSF framework and Struts framework was compared.
     The thesis takes Luzhou Beifang Plan Management Information System (PMIS) as an example implement. It was discussed in detail that JSF was applied in PMIS. Aimed at the application of JSF, the thesis points out some extension and insufficiency, and provides the solution. Asynchronous JavaScript and XML (AJAX) is a new client-side technology. In viewof the weakness of JSF in client-side, the thesis introduces the client-side framework------AJAX4JSF in Web application system. It can reduce the loader of server-side and raise the response speed. In developing Web application, it can improve the efficiency of program development and the performance of software and can enhance the expendability, reusability, maintenance and flexibility of Web application system by applying JSF.
引文
1赖英旭,刘增辉,李毛毛.MVC模式在B/S系统开发中的应用研究[J].微计算机信息,2006(30):62-65
    2王海蓉,苗放.基于MVC模式的Struts框架的研究与应用[J].电脑知识与技术,2006(26):102-103
    3左学明,张力.一种新的基于JSF技术的Web用户界面开发方法[J].计算机应用,2005(25):215-217
    4杜小刚,李舟军.J2EE Web开发框架体系结构[J].计算机科学,2006(8):236-239
    5郑耿忠.J2EE多层体系结构在远程教育平台中的应用研究[J].石河子大学学报,2006(1):127-130
    6Stephanie Bodoff等著.田玉敏,沈金河等译.J2EE 1.4标准教程(第二版)[M].北京:电子工业出版社,2005
    7Deepal Alur著.刘天北译.J2EE核心模式[M].北京:机械工业出版社,2005
    8孙福振,李艳,李业刚.基于J2EE的MVC设计模式的研究与实现[J].山东理工大学学报,2006(2):49-53
    9Eekel B著.侯捷译.Java编程思想[M].北京:机械工业出版社,2002
    10吴建设.MVC设计模式在Web应用程序中的研究与实现[J].福建电脑,2006(2):66-67
    11阎宏.Java与模式[M].北京:电子工业出版社,2002
    12Cay S.Horstmann,Gary Comell著.陈吴鹏译.Java 2核心技术卷Ⅱ:高级特性[M].北京:机械工业出版社,2006
    13Kito.Mann.JavaServer Faces in Action[M].Greenwich:Manning Publications,2005
    14Bergsten H.JavaServer Faces[M].Sebastopol,CA:O'Reilly&Associates Inc,2004
    15Gearcone D.Core JavaServer Faces[M].Assidon Wesley,2004
    16Sun Microsystems Inc.JavaServer Faces Specification,Version 1.1
    17BillDudney,JonathanLehr,BillWilliis,LeroyMattingly著.孙勇,蔡云志译.Mastering JavaServer Faces中文版[M].北京:电子工业出版社,2005
    18Kirkley,John.Making Faces:JavaServer Faces(JSF)provides a powerful new framework for creating Web GUIs[J].Oracle Magazine.2004(4):69-70
    19Oleg Rostanin.An Alternative Approach to Building Web-Applications[J].Databases and Information Systems Integration,ICEIS 2004:119-124
    20汤琪亮,高海锋.JavaServer Faces技术在网络开发中的应用[J].计算机工程与设计.2006(10):1895-1898
    21万正景,陶以政.基于JSF技术的Web应用程序开发[J].现代电子技术.2007(4):135-137
    22赵冬生,王冠宇.建立JSF自定义复合组件[J].微计算机信息.2006(22):269-271
    23戴浩.利用JavaServer Faces技术开发Web应用程序[J].微型机与应用.2004(12):15-17
    24李步升,王华.事件驱动在Web开发中的应用[J].福建电脑,2005(10):55-56
    25万亮,熊前兴,阎冰洁.JSF与Spring集成应用研究[J].电脑知识与技术,2006(8):53-55
    26李发行,徐晓宏.JSF框架的研究及应用[J].福建电脑,2006(1):95-96
    27朱庆生,葛亮.新一代Web应用框架JSF[J].计算机科学,2005(12):58-60
    28王冠宇,赵冬生.基于J2EE下的JSF与Struts框架比较分析[J].微机发展,2005(12):58-60
    29白金东,陈杰.基于JSF架构的WEB应用开发研究[J].科技情报开发与经济,2005(10):223-224
    30苏一,张发勇,范武.基于JSF与Hibernate的Web应用开发[J].软件导刊,2005(17):8-10
    31使用JSF架构进行设计.http://www.ibm.com/developerworks/cn/java/wa-dsgnpatjsf.html
    32Sun MicroSystems.JSF reference implementation.http://java.Sun.com/j2ee/javaserverfaces
    33Virtua.JSF Central JavaServer Faces community and FAQ.http://www.jsfcentral.com
    34探索JSF框架中使用的设计模式.http://bbs.hexiao.cn
    35Qusay H.Mahmoud.Developing Web Application with JavaServer Faces.http://java.sun.com/developer/technicalArticles/GUI/JavaServerFaces/
    36Derek Yang Shen.Put JSF to work.http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html
    37Ryan Asleson,Nathaniel T.Schutta著.金灵等译.Ajax基础教程[M]北京:人民邮电出版社,2006
    38Dave Crane,Eric Pascarello,Darren Jamss著.ajaxcn.org译.Ajax实战[M].北京:人民邮电出版社,2006
    39王沛,冯曼菲.征服Ajax——Web2.0开发技术详解[M].北京:人民邮电出版社,2006

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700