1007052242_冯晨_外文文献翻译.doc_第1页
1007052242_冯晨_外文文献翻译.doc_第2页
1007052242_冯晨_外文文献翻译.doc_第3页
1007052242_冯晨_外文文献翻译.doc_第4页
1007052242_冯晨_外文文献翻译.doc_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

JSP的技术发展历史毕业设计(论文)外文文献翻译院 系:计算机与信息工程学院年级专业:10软件工程姓 名:冯晨学 号:1007052242附 件:T 指导老师评语: 该生外文翻译的内容是XXXX,该生的英文阅读和翻译能力较强,但部分语法该生经过大量地查阅与XXXX相关的国内外文献,较好地掌握了该研究领域的专业知识,从而较准确地翻译了该外文文献,语句通顺,层次分明。译文原文字数大于3000实词,符合翻译数量要求。指导教师签名:年 月 日JSP技术与主流JAVA EE开源框架(SSH)技术简介作者: Bryan Basham,Kathy Sierra,Bert Bates出处: IEEE国际计算机和信息技术会议纪要(CIT2010) 时间: 2010-071 JAVA技术简介JSP(Java Server Pages)是由Sun公司倡导、许多公司参与一起建立的一种动态网页技术标准。JSP技术有点类似ASP技术,它是在传统的网页HTML文件中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件。用JSP开发的Web应用是跨平台的,即能在Linux运行,也能在其他操作系统上运行。JSP技术使用Java编程语言编写类XML的tags和Scriptlets,来封装产生动态网页的处理逻辑。网页还能通过tags和Scriptlets访问存在于服务端的资源的应用逻辑。JSP将网页逻辑与网页设计和显示分离,支持可重用的基于组件的设计,使基于Web的应用程序的开发变得迅速和容易。Web服务器在遇到访问JSP网页的请求时,首先执行其中的程序段,然后将执行结果连同JSP文件中的HTML代码一起返回给客户。插入的Java程序段可以操作数据库、重新定向网页等,以实现建立动态网页所需要的功能。JSP与Java Servlet一样,是在服务器端执行的,通常返回该客户端的就是一个HTML文本,因此客户端只要有浏览器就能浏览。JSP的1.0规范的最后版本是1999年9月推出的,12月又推出了1.1规范。日前较新的是JSP 1.2规范,JSP2.0规范的征求意见稿也已出台。JSP页而由HTML代码和嵌入其中的java代码所组成。服务器在页而被客户端请求以后对这些java代码进行处理,然后将生成的HTML页而返回给客户端的浏览器。Java Servlet是JSP的技术基础,而且大型的Web应用程序的开发需要Java和JSP配合才能完成。JSP具备了Java技术的简单易用,完全的而向对象,其有平台无关性且安全可靠,主要而向因特网的所有特点。2 J2EE开发框架Java2企业版为中间件领域思想的统一上发挥了很大的作用。比如,J2EE为分布式事务管理、目录服务和消息服务提供了一套标准的编程接口。J2EE的基础Java2标准版(J2SE) ,成功地为Java提供了一套访问关系数据库的标准。但是,就像很多J2EE开发工具自动产生的代码像这些工具本身同样复杂。在开源社区很多小型J2EE开发者选择了另外一种开发方式 一些可以降低J2EE开发难度的开发框架,较为流行的比如:Struts, Hibernate, 和 Spring Framework,他们当今很多J2EE项目种扮演着重要角色。2.1 Spring框架Spring Framework是一个开源的Java/java EE全功能栈(full-stack)的应用程序框架,以Apache许可证形式发布,也有.NET平台上的移植版本。该框架基于Expert One-on-One Java EE Design and Development(ISBN 0-7645-4385-7)一书中的代码,最初由Rod Johnson等开发。Spring Framework提供了一个简易的开发方式,这种开发方式,将避免那些可能致使底层代码变得繁杂混乱的大量的属性文件和帮助类。Spring中包含的关键特性:强大的基于JavaBeans的采用控制翻转原则的配置管理,使得应用程序的组建更加快捷简易。一个可用于从applet到JavaEE等不同运行环境的核心Bean工厂。数据库事务的一般化抽象层,允许声明式事务管理器,简化事务的划分使之与底层无关。内建的针对JTA和单个JDBC数据源的一般化策略,使Spring的事务支持不要求JavaEE环境,这与一般的JTA或者EJB CMT相反。JDBC抽象层提供了有针对性的异常等级(不再从SQL异常中提取原始代码),简化了错误处理,大大减少了程序员的编码量。再次利用JDBC时,你无需再写出另一个终止(finally)模块。并且面向JDBC的异常与Spring通用数据访问对象(Data Access Object)异常等级相一致。以资源容器,DAO实现和事务策略等形式与Hibernate,JDO 和 iBATIS SQL Maps集成。利用众多的翻转控制方便特性来全而支持,解决了许多典型的Hibernate集成问题。所有这些全部遵从Spring通用事务处理和通用数据访问对象异常等级规范。灵活的基于核心Spring功能的MVC网页应用程序框架。开发者通过策略接口将拥有对该框架的高度控制,因而该框架将适应于多种呈现(VIEW)技术,例如Jsp FreeMarker,Velocity,Tiles,iText以及POI。值得注意的是,Spring中间层可以轻易地结合于任何基于MVC框架的网页层,例如Struts,WebWork,或Tapestry,提供诸如事务管理等服务的而向方而编程框架。在设计应用程序简洁明了的框架结构Model时,MVC模式(例如struts)通常难于给出一个简洁明了的框架结构。Spring却具有能够让这部分上作变得简单的能力。程序开发员们可以使用Spring的JDBC抽象层重新设计那些复杂的框架结构。2.2 Struts技术介绍Struts项目是Apache软件基金会(ASF)赞助的一个开源项日。它最初是Jakarta项目中的一个子项目,并在2004年3月成为ASF的顶级项目。它通过采用Java Servlet/JSP技术,实现了基于Java EE Web应用的Model-View-ControllerMVC设计模式的应用框架(web Framework),是MVC经典设计模式中的一个经典产品。MVC结构在Struts中,已经由一个名为ActionServlet的Servlet充当控制器(Controller)的角色,根据描述模型、视图、控制器对应关系的struts-config.xml的配置文件,转发视图(view)的请求,组装响应数据模型(Model)。在MVC的模型(Model)部分,经常划分为两个主要子系统(系统的内部数据状态与改变数据状态的逻辑动作),这两个概念子系统分别具体对应struts里的ActionForm与Action两个需要继承实现超类。在这里,Struts可以与各种标准的数据访问技术结合在一起,包括Enterprise Java Bean(EJB),JDBC与JNDL。在struts的视图(view)端,除了使用标准的Java Server Pages(JSP)以外,还提供了大量的标签库使用,同时也可以与其他表现层组件技术(产品)进行整合,比如XSLT等。通过应用struts的框架,最终用户可以把大部分的关注点放在自己的业务逻辑(Action)与映射关系的配置文件(struts-config.xml)中。发展历程在JavaEE的Web应用发展的初期,除了使用Servlet技术以外,普遍是在JSP的源代码中,采用HTML与java代码混合的方式进行开发。因为这两种方式不可避免的要把表现与业务逻辑代码混合在一起,都给前期开发与后期维护带来巨大的复杂度。为了摆脱上述的约束与局限,把业务逻辑代码从表现层中清晰的分离出来,2000年,CraigMcClanahan采用了MVC的设计模式开发Struts。后来该框架产品一度被认为是最广泛、最流行Java的WEB应用框架。2006年,Webwork与Struts这两个优秀的Java EEweb框架(Web FrameWork)的团体,决定合作共同开发一个新的,整合了WebWork与Struts优点,并且更加优雅、扩展性更强的框架,命名为“Struts2 ,原Struts的1.x版本产品称为“Struts1”至此,Struts项目并行提供与维护两个主要版本的框架产品一一Struts1与Struts2。很多开发人员认为Shuts目前尚不成熟,应用的成本较高。附带的一点点建议:Struts的优点主要集中体现在两个方而:Taglib和页而异航。Taglib是Struts的标记库,灵活动用,能大大提高开发效率。Struts这个名字来源于建筑和旧式飞机中使用的支持金属架。它的目的是为了减少在运用MVC设计模型来开发java应用的时间。你仍然需要学习和应用该架构,不过将可以完成其中一些繁重的工作。Struts跟Tomcat、Turbine等诸多Apache项目一样,是开源软件,这是它的一大优点,使开发者能更深入的了解其内部实现机制。2.3 Hibernate开源框架介绍Hibernate是一种Java语言下的对象关系映射解决方案。它是使用GNU宽通用公共许可证发行的自由、开源的软件。它为面向对象的领域模型到传统的关系型数据库的映射,提供了一个使用方便的框架。概览它的设计目标是将软件开发人员从大量相同的数据持久层相关编程上作中解放出来。无论是从设计草案还是从一个遗留数据库开始,开发人员都可以采用Hibernate。Hibernate不仅负责从java类到数据库表的映射(还包括从java数据类型到SQL数据类型的映射),还提供了面向对象的数据查询检索机制,从而极大地缩短的手动处理SQL和JDBC上的开发时间。.NET上的hibernatehibernate有个在.NET上的实现版本,称为NHibernate,在ADO.NET Entity Framework发表之前,NHibernate是在.NET Framework上经常被使用的ORM实现。hibernate的架构有三个主要部分组成:(1). 连接管理:hibernate的连接管理服务提供的数据库连接的有效管理。数据库连接是与数据库进行交互,因为需要大量资源的开放和关闭数据库连接的最昂贵的部分。(2). 交易管理:事务管理服务提供给用户能够同时执行多个数据库报表。(3). 对象关系映射:对象关系映射从对象映射模型的数据表示为关系数据模型的技术。这部分是用来休眠选择,插入,更新和删除记录窗体的基础表。当我们传递一个对象到Session.save()的方法时,Hibernate读取该对象的变量的状态,并执行必要的查询。hibernate是很好的工具尽可能对象关系映射的关注,但在连接管理和事务管理方而,它在性能和能力缺乏。所以通常冬眠与其他正在使用的连接管理和事务管理上具。Hibernate提供了使用中的灵活性。它被称为“轻型”的体系结构时,我们只使用对象关系映射的组成部分。而在“全而解决”的体系结构的所有三个组件对象关系映射,连接管理和事务管理)的使用。13JSP technology and mainstream open-source framework for JAVAEEJSP technology and mainstream open-source framework for JAVAEE1. JSP ProfileJSP (Java Server Pages) is initiated by Sun Microsystems, Inc., with many companies to participate in the establishment of a dynamic web page technical standards. JSP technology somewhat similar to ASP technology, it is in the traditional HTML web page document (*.htm, *. html) to insert the Java programming paragraph (Scriptlet) and JSP tag (tag), thus JSP documents (*.jsp). Using JSP development of the Web application is cross-platform that can run on Linux, is also available for other operating systems.JSP technology to use the Java programming language prepared by the category of XML tags and scriptlets, to produce dynamic pages package processing logic. Page also visit by tags and scriptlets exist in the services side of the resources of logic. JSP page logic and web page design and display separation, support reusable component-based design, Web-based application development is rapid and easy.Web server in the face of visits JSP page request, the first implementation of the procedures of, and then together with the results of the implementation of JSP documents in HTML code with the return to the customer. Insert the Java programming operation of the database can be re-oriented websites, in order to achieve the establishment of dynamic pages needed to function.JSP and Java Servlet, is in the implementation of the server, usually returned to the client is an HTML text, as long as the client browser will be able to visit.JSP 1.0 specification of the final version is launched in September 1999, December has introduced 1.1 specifications. At present relatively new is JSP1.2 norms, JSP2.0 norms of the draft has also been introduced.JSP pages from HTML code and Java code embedded in one of the components. The server was in the pages of client requests after the Java code and then will generate the HTML pages to return to the client browser. Java Servlet JSP is the technical foundation and large-scale Web application development needs of Java Servlet and JSP support to complete. JSP with the Java technology easy to use, fully object-oriented, and a platform-independent and securemainly for all the characteristics of the Internet. JSP technology strength: (1) time to prepare, run everywhere. At this point Java better than PHP, in addition to systems, the code not tomake any changes.(2) the multi-platform support. Basically on all platforms of any development environment, in any environment for deployment in any environment in the expansion. Compared ASP / PHP limitations are obvious. (3) a strong scalability. From only a small Jar documents can run Servlet / JSP, to the multiple servers clustering and load balancing, to multiple Application for transaction processing, information processing, a server to numerous servers, Java shows a tremendous Vitality. (4) diver sification and powerful development tools support. This is similar to the ASP, Java already have many very good development tools, and many can be free, and many of them have been able to run on a variety of platforms under. JSP technology vulnerable:(1) and the same ASP, Java is the advantage of some of its fatal problem. It is precisely because in order to cross-platform functionality, in order to extreme stretching capacity, greatly increasing the complexity of the product. (2) Javas speed is class to complete the permanent memory, so in some cases by the use of memory compared to the number of users is indeed a minimum cost performance. On the other hand, it also needs disk space to store a series of. Java documents and. Class, as well as the corresponding versions of documents.2. J2EE Development FrameworkJava2 Enterprise Edition middleware unified ideology played a significant role. For example, J2EE for distributed transaction management, directory services and messaging services provide a standard programming interface. J2EE-based -Java2Standard Edition (J2SE), successfully access for Java provides a standard relational database.But, as this article J2EE programming of the lack of support, as mentioned, J2EEplatform does not provide a satisfactory application programming model. Sun and some of the major application server vendors wanted to use the development tools to reduce the complexity of J2EE development, but these tools are no other outstanding JAVA development tools, which have advanced refactoring tools, and. NET platform compared, J2EE tool support appeared to be very inferior.Many J2EE development tools automatically generate the code for the same complex as the tools themselves. In many small-scale J2EE open source community developers chose another way of development - some can be difficult to reduce the development of J2EE development framework, the more popular such as: Struts, Hibernate, and Spring Framework, J2EE project types in many of today they play an important the role.2.1 Spring FrameworkThe Spring Framework is an open source application framework for the Java platform.The first version was written by Rod Johnson who released the framework with the publication of his book Expert One-on-One J2EE Design and Development in October 2002. The framework was first released under the Apache 2.0 license in June 2003. The first milestone release, 1.0, was released in March 2004, with further milestone releases in September 2004 and March 2005. The Spring 1.2.6 framework won a Jolt productivity award and a JAX Innovation Award in 2006. Spring 2.0 was released in October 2006, and Spring 2.5 in November 2007. In December 2009 version 3.0 GA was released. The current version is 3.0.5.The core features of the Spring Framework can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform. Although the Spring Framework does not impose any specific programming model, it has become popular in the Java community as an alternative to, replacement for, or even addition to the Enterprise JavaBean (EJB) model.ModulesThe Spring Framework comprises several modules that provide a range of services:Inversion of Control container: configuration of application components and lifecycle management of Java objectsAspect-oriented programming: enables implementation of cross-cutting routines Data access: working with relational database management systems on the Java platform using JDBC and object-relational mapping toolsTransaction management: unifies several transaction management APIs and coordinates transactions for Java objectsModel-view-controller: an HTTP and Servlet-based framework providing hooks for extension and customizationRemote Access framework: configurative RPC-style export and import of Java objects over networks supporting RMI, CORBA and HTTP-based protocols including web services (SOAP)Convention-over-configuration: a rapid application development solution for Spring-based enterprise applications is offered in the Spring model.Batch processing: a framework for high-volume processing featuring reusablefunctions including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource managementAuthentication and authorization: configurable security processes that support a range of standards, protocols, tools and practices via the Spring Security sub-project (formerly Acegi Security System for Spring).Remote Management: configurative exposure and management of Java objects for local or remote configuration via JMXMessaging: configurative registration of message listener objects for transparent message consumption from message queues via JMS, improvement of message sending over standard JMS APIsTesting: support classes for writing unit tests and integration testsInversion of Control containerCentral to the Spring Framework is its Inversion of Control container, which provides a consistent means of configuring and managing Java objects using callbacks. The container is responsible for managing object lifecycles: creating objects, calling initialization methods, and configuring objects by wiring them together.Objects created by the container are also called Managed Objects or Beans. Typically, the container is configured by loading XML files containing Bean definitions which provide the information required to create the beans.Objects can be obtained by means of Dependency lookup or Dependency injection. Dependency lookup is a pattern where a caller asks the container object for an object with a specific name or of a specific type. Dependency injection is a pattern where the container passes objects by name to other objects, via either constructors, properties, or factory methods.In many cases its not necessary to use the container when using other parts of the Spring Framework, although using it will likely make an application easier to configure and customize. The Spring container provides a consistent mechanism to configure applications and integrates with almost all Java environments, from small-scale applications to large enterprise applications.The container can be turned into a partially-compliant EJB3 container by means of the Pitchfork project. The Spring Framework is criticized by some as not being standards compliant. However, SpringSource doesnt see EJB3 compliance as a major goal, and claims that the Spring Framework and the container allow for more powerful programming models.Aspect-oriented programming frameworkThe Spring Framework has its own AOP framework which modularizes cross-cutting concerns in aspects. The motivation for creating a separate AOP framework comes from the belief that it would be possible to provide basic AOP features without too much complexity in either design, implementation, or configuration. The SAOP framework also takes full advantage of the Spring Container.The Spring AOP framework is interception based, and is configured at runtime. This removes the need for a compilation step or load-time weaving. On the other hand, interception only allows for public or protected method execution on existing objects at a join point.Compared to the AspectJ framework, Spring AOP is less powerful but also less complicated. Spring 1.2 includes support to configure AspectJ aspects in the container. Spring 2.0 added more integration with AspectJ; for example, the pointcut language is reused and can be mixed with SpAOP-based aspects. Further, Spring 2.0 added a Spring Aspects library which uses AspectJ to offer common Spring features such as declarative transaction management and dependency injection via AspectJ compile-time or load-time weaving. SpringSource also uses AspectJ for AOP in other Spring projects such as Spring Roo and Spring Insight, with Spring Security also offering an AspectJ-based aspect library.Spring AOP has been designed to make it able to work with cross-cutting concerns inside the Spring Framework. Any object which is created and configured by the container can be enriched using Spring AOP.The Spring Framework uses Spring AOP internally for transaction management, security, remote access, and JMX.Since version 2.0 of the framework, Spring provides two approaches to the AOP configuration:schema-based approach.AspectJ-based annotation style.The Spring team decided not to introduce new AOP-related terminology; therefore, in the Spring reference documentation and API, terms such as aspect, join point, advice, pointcut, introduction, target object (advised object), AOP proxy, and weaving all have the same meanings as in most other AOP frameworks (particularly AspectJ).Data access frameworkSprings data access framework addresses common difficulties developers face when working with databases in applications. Support is provided for all popular data access frameworks in Java: JDBC, iBatis, Hibernate,JDO, JPA, Oracle TopLink, Apache OJB, and Apache Cayenne, among others.For all of these supported frameworks, Spring provides these features:Resource management - automatically acquiring and releasing database resourcesException handling - translating data access related exception to a Spring data access hierarchyTransaction participation - transparent participation in ongoing transactionsResource unwrapping - retrieving database objects from connection pool wrappersAbstraction for BLOB and CLOB handlingAll these features become available when using Template classes provided by Spring for each supported framework. Critics say these Template classes are intrusive and offer no advantage over using (for example) the Hibernate API. directly. In response, the Spring developers have made it possible to use the Hibernate and JPA APIs directly. This however requires transparent transaction management, as application code no longer assumes the responsibility to obtain and close database resources, and does not support exception translation.Together with Springs transaction management, its data access framework offers a flexible abstraction for working with data acce

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论