JSP及其WEB技术外文翻译资料

 2022-08-27 10:17:12

JSP and WEB technology

1 JSP Introduction

JSP (Java Server Pages) is a Java-based scripting technology. Is advocated by Sun Microsystems Inc., together with a number of companies involved in the establishment of a dynamic web page technology standards. JSP technology is somewhat similar to ASP technology, It is a traditional HTML page file (*. htm, *. html) to insert Java program segment (Scriptlet) and JSP tag (tag), To form the JSP file(*jsp). Web development with JSP is a cross-platform applications that can run under Linux, but also in other operating systems. In the JSP of the many advantages, one of which is that it will be HTML encoded Web page from the business logic separated effectively. JSP access with reusable components, such as Servlet, JavaBean and Java-based Web applications. JSP also supports directly in the Web page embedded Java code. JSP can be used two ways to access documents: JSP documents sent by the browser request, the request sent to the Servlet. JSP technology uses Java programming language, XML-type tags and scriptlets, to have a package deal with the logic of dynamic pages. Page tags and scriptlets can also exist in the server access to the resources of the application logic. JSP logic and Web page design and display isolated and support reusable component-based design, Web-based applications more quickly and easily developed.

The Web server when meets visits the JSP homepage the request, first carries out segment, will then carry out the result code to return together with JSP in the document HTML for the customer. The insertion Java segment may operate the database, again the directional homepage and so on, realizes the function which the establishment dynamic homepage needs. JSP and Java Servlet are the same, is in the server end execution, usually returns to this client side is a HTML text, therefore client side, so long as has the browser to be able to glance over.

The JSP page is composed of the HTML code and the inserting Java code. The server in the page by the client side was requested that later will carry on processing to these Java code, will then produce the HTML page will return gives the client side the browser. Java Servlet is the JSP technology base, moreover the large-scale Web application procedures development needs Java Servlet and the JSP coordination can complete. JSP had the Java technology simply easy to use, complete object-oriented, had the platform independency, and safe reliable, mainly faced Internets all characteristics.

2 JSP computing technique

To carry on the dynamic website conveniently fast the development, JSP has made the improvement in the following several aspects, causes it to become builds the cross platform fast the dynamic website first choice plan.

2.1 carries on the content production and the demonstration separates

With the JSP technology, the Web page development personnel may use HTML or the XML marking design and the formatted final page, and uses the JSP marking or the tootsy produces on pages dynamic content originally. Production contents logic is sealed in marks and in the JavaBeans module, and ties up in the script, all scripts in server end movement. Because core logic is sealed in marks and in JavaBeans, therefore the Web administrative personnels and the page designer, can edit and use the JSP page, but does not affect the content the production. In the server end, the JSP engine explained that the JSP marking and the script, produce the content which requested, and (or XML) pages form transmits the result by HTML the browser. This both are helpful in the author protects own code, and can guarantee any based on the HTML Web browsers complete usability.

2.2 may entrust with heavy responsibility the module

The overwhelming majority JSP page relies on may entrust with heavy responsibility, the cross platform module (JavaBeans or Enterprise the JavaBeans module) carries out complex processing which the application procedure requests. The development personnel can share and exchange the execution ordinary operation the module, or causes these modules uses for more users and the customer association. Has accelerated the overall development process based on modules method, and causes each kind of organization obtains balanced in their existing skill and in the optimized result development endeavor.

2.3 uses marking

The Web page development personnel will not be the familiar script language programmers. The JSP technology has sealed many functions, these functions are easy to use, marking to carry on the dynamic content production with JSP in the related XML to need. The standard JSP marking can visit and the instantiation JavaBeans module, the establishment or the retrieval module attribute, downloads Applet, as well as the execution difficulty with codes and the time-consuming function with other methods.

2.4 adapts the platform

Nearly all platforms support Java, JSP JavaBeans to be possible to pass unimpeded nearly under all platforms. Transplants from a platform to other platform, JSP and JavaBeans does not even need to translate, because the Java byte code is standard has nothing to do with the platform.

2.5 database connection

In Java connects the database the technology is the JDBC, Java procedure is connected through the JDBC driver and the database, operations and so on execution inquiry, extraction data. Sun Corporation has also developed JDBC-ODBC bridge, uses this technical Java procedure to be possible to visit has the ODBC driver database, at present the majority database systems have the ODBC driver, therefore the Java procedure can visit such as Oracle, Sybase, MS SQL Server and databases and so on MS Access. In addition, through the development marking storehouse, the JSP technology may further expand. The third party development personnel and other personnel may

剩余内容已隐藏,支付完成后下载完整资料


JSP及其WEB技术

1 JSP简介

JSP(Java Server Pages)是一种基于Java的脚本技术。是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准。JSP技术有点类似ASP技术,它是在传统的网页HTML文件(*.htm,*.html)中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件(*.jsp)。用JSP开发的Web应用是跨平台的,即能在Linux下运行,也能在其他操作系统上运行。在JSP 的众多优点之中,其中之一是它能将 HTML 编码从 Web 页面的业务逻辑中有效地分离出来。用 JSP 访问可重用的组件,如 Servlet、JavaBean 和基于 Java 的 Web 应用程序。JSP 还支持在 Web 页面中直接嵌入 Java 代码。可用两种方法访问 JSP 文件:浏览器发送 JSP 文件请求、发送至 Servlet 的请求。JSP技术使用Java编程语言编写类XML的tags和scriptlets,来封装产生动态网页的处理逻辑。网页还能通过tags和scriptlets访问存在于服务端的资源的应用逻辑。JSP将网页逻辑与网页设计和显示分离,支持可重用的基于组件的设计,使基于Web的应用程序的开发变得迅速和容易。

Web服务器在遇到访问JSP网页的请求时,首先执行其中的程序段,然后将执行结果连同JSP文件中的HTML代码一起返回给客户。插入的Java程序段可以操作数据库、重新定向网页等,以实现建立动态网页所需要的功能。JSP与Java Servlet一样,是在服务器端执行的,通常返回该客户端的就是一个HTML文本,因此客户端只要有浏览器就能浏览。

JSP页面由HTML代码和嵌入其中的Java代码所组成。服务器在页面被客户端请求以后对这些Java代码进行处理,然后将生成的HTML页面返回给客户端的浏览器。Java Servlet 是JSP的技术基础,而且大型的Web应用程序的开发需要Java Servlet和JSP配合才能完成。JSP具备了Java技术的简单易用,完全的面向对象,具有平台无关性且安全可靠,主要面向因特网的所有特点。

2 JSP技术方法

为了快速方便地进行动态网站的开发,JSP在以下几个方面做了改进,使其成为快速建立跨平台的动态网站的首选方案。

2.1 将内容的生成和显示进行分离

用JSP技术,Web页面开发人员可以使用HTML或者XML标识来设计和格式化最终页面,并使用JSP标识或者小脚本来生成页面上的动态内容。生成内容的逻辑被封装在标识和JavaBeans组件中,并且捆绑在脚本中,所有的脚本在服务器端运行。由于核心逻辑被封装在标识和JavaBeans中,所以Web管理人员和页面设计者,能够编辑和使用JSP页面,而不影响内容的生成。在服务器端,JSP引擎解释JSP标识和脚本,生成所请求的内容,并且将结果以HTML(或者XML)页面的形式发送回浏览器。这既有助于作者保护自己的代码,又能保证任何基于HTML的Web浏览器的完全可用性。

2.2 可重用组件

绝大多数JSP页面依赖于可重用的、跨平台的组件(JavaBeans或者Enterprise JavaBeans组件)来执行应用程序所要求的复杂的处理。开发人员能够共享和交换执行普通操作的组件,或者使得这些组件为更多的使用者和客户团体所使用。基于组件的方法加速了总体开发过程,并且使得各种组织在他们现有的技能和优化结果的开发努力中得到平衡。

2.3 采用标识

Web页面开发人员不会都是熟悉脚本语言的编程人员。JSP技术封装了许多功能,这些功能是在易用的、与JSP相关的XML标识中进行动态内容生成所需要的。标准的JSP标识能够访问和实例化JavaBeans组件,设置或者检索组件属性,下载Applet,以及执行用其他方法更难于编码和耗时的功能。

2.4 适应平台

几乎所有平台都支持Java,JSP+JavaBeans几乎可以在所有平台下通行无阻。从一个平台移植到另外一个平台,JSP和JavaBeans甚至不用重新编译,因为Java字节码都是标准的与平台无关的。

2.5 数据库连接

Java中连接数据库的技术是JDBC,Java程序通过JDBC驱动程序与数据库相连,执行查询、提取数据等操作。Sun公司还开发了JDBC-ODBC bridge,利用此技术Java程序可以访问带有ODBC驱动程序的数据库,目前大多数数据库系统都带有ODBC驱动程序,所以Java程序能访问诸如Oracle、Sybase、MS SQL Server和MS Access等数据库。此外,通过开发标识库,JSP技术可以进一步扩展。第三方开发人员和其他人员可以为常用功能创建自己的标识库。这使得Web页面开发人员能够使用熟悉的工具和如同标识一样的执行特定功能的构件来进行工作。JSP技术很容易整合到多种应用体系结构中,以利用现存的工具和技巧,并且能扩展到支持企业级的分布式应用中。

3 Eclipse功能简介

越来越多的Java开发人员已经开始欣赏Eclipse的JDT提供的生产率和质量收益。它为Java编辑器提供了语法高亮显示、格式化、折叠、内容辅助、代码模板等许多功能。它不断增长的可用重构和代码生成功能集合允许您在更高的级别上操作代码,并自动化通常的代码密集型任务和易错任务。而且,在开发完代码并使用JDT对编写和执行JUnit测试的内置支持对代码进行单元测试之后,可以使用Eclipse的一流Java调试器调试在运行时遇到的任何问题。除了JDT之外,Eclipse SDK—最流行的Eclipse.org下载—还包含Plug-in Development Environment(PDE)。PDE使用特定功能扩展了JDT以构建Eclipse插件—基于Eclipse的应用程序的基本构造块。事实上,使用由Eclipse本身提供的工具能够超越Java开发,可扩展现有Eclipse应用程序,或者甚至创建全新的应用程序。

Eclipse由一个小程序层构成,其中包含许多功能模块或Eclipse术语中所谓的“插件”。插件是在Eclipse应用程序中提供所有功能的组件。它们通过其API一起协作来交付最终结果。在Eclipse中,甚至最基础的功能,比如查找和启动安装的插件,都封装在插件中。为了扩展现有Eclipse功能或在其上进行构建,插件将具体的扩展贡献给由其他插件暴露的扩展点。通常,插件专注于特定区域的责任,并通过一个或多个扩展点的方式将其他责任指派给其他插件。例如,一个插件允许您可视地并行比较两个文件的内容,但它不会关心如何读取这些文件甚至如何解释这些文件的结构;这是其他插件的工作。比较两个文件时,该插件首先检查是否有另一个插件可以解释这些文件的结构。如果找到一个,它就会向找到的插件询问有关文件结构的信息,并在比较过程中使用该信息。

可以看到,模块化架构为Eclipse提供了巨大的灵活性,并提供了一个可以支持原设计者没有预料到的大量应用程序的平台。

4 Spring Web框架简介

4.1介绍:Spring 应用构架

当你第一次看到Spring的时候,你一定会说:'哦不,又一种web 构架'.这篇文章将告诉你Spring明显区别于其他轻量级application framework, 它将专注于web的支持,与struts 和 webwork有着明显的区别。

在和struts 和 webwork的对比上,Spring是一个服务于所有层面的application framework:提供了bean的配置基础,AOP的支持,JDBC的提取框架,抽象事务支持,等等。它有一个非常显著的特点:在某个层面上如果你不需要Spring的支持,你就可以不使用String的class,只使用它的某一部分的功能。 从它的设计理念,你可以看到String 帮助你实现了真正的逻辑层和web层的分离:例如。一个校验应用将不用依靠controllers,就可以实现。这样的目标是 更好的重用和易测:过分依靠不必要的容器和框架将不能实现这一点。

当然,Spring 的自己的web支持和通常框架模式的细致完整.然而,Spring替换struts, webwork或者其他的web方案非常的容易.对于Spring的web支持或者不同的地方,Spring 允许你在web容器里面建立一个中间层,在测试环境或者标准独立的应用里面来设置重用你的商务逻辑.还有在J2EE环境里面,你的商务逻辑不必依靠容器提供的服务,像JTA ,EJB的支持.良好的构架的web应用可以运行在任何容器上,如,Tomcat 或者 Resin. 值得注意的是,Spring 不是和已经存在的解决方案进行竞争. 我们鼓励结合标准的技术,如, Servlet, JSP, JTA, JNDI, JDBC, and JDO, 和非常匹配的工具,如,Hibernate, Velocity, Log4J, and Cauchos Hessian/Burlap.这个框架的的设计思想是在你的应用需要改良的时候,你将会做一些技术的选择:例如,如果你需要分布式事务处理,你可能需要用Spring的Jta TransactionManager 来实现JTA服务.或者,用DataSourceTransactionManager or HibernateTransactionManager 来实现美妙完美的单个数据库交换。

4.2 Web MVC: Spring web 框架的设计思想

Spring 框架通过配置操作mappings,展示resolution,本地化和模版集成围绕着分派请求操作的servlet - DispatcherServlet设计的.缺省的操作是一个非常简单的控制接口, 他只提供了ModelAndView handleRequest(request,response)方法.这将用于一个应用的控制,但是,如果你想包含多个层次的控制,AbstractController, AbstractCommandController, MultiActionController, SimpleFormController, AbstractWizardFormController 将帮助你完成.应用控制将代表那些子系统.注意,你可以选择一个适当的基类:如果你没有 web form,你就不必用FormController.这就是和Struts最大的不同. 你可以通过命令或者form对象来操作任何对象:这不需要接口工具或者一个基础类的驱动.Spring的数据邦定是非常的灵活的.举例来说,它描述了具有在应用范围内的校验错误的输入机制,但不是系统错误.所以在你的form对象里面你不必复制你的业务对象的string属性,只操作出错的子任务,或者适当地转换string.换句话说,它通常可以很好的直接邦定你的业务对象. 这也是和struts围绕请求基础类Action 和 ActionForm (每个action操作类型) 建立主要的不同之一. 对比WebWork, Spring更多的区别在于对象角色:Sping支持控制器的感念,一个操作命令或者form对象,和得到数据传递给视图的模式.这个模式通常包含命令和form对象,但有时也包含任意的参考数据.换句话说,一个WebWork Action联合所有这些角色到一个单独的对象.WebWork 允许你用已经存在的业务对象作为你 form 的一部分,但是只生成各自Action 的 bean 属性. 最后,操作请求的Action 实例在一个视图里面获得付值和form population. 然而,参考数据也需要作为Action 的属性被模拟. 一个类里面有太多的角色是值得讨论的. 关于视图:Spring的视图方案非常的灵活. 一个控制器执行可以通过response 返回ModelAndView对象null,就可以直接写到一个视图.在通常的状况下,一个ModelAndView实例结合了 一个view 和一个 model Map,包含了bean name 和 通讯对象(像命令或者form,参考数据等等). View名称是非常高端的的配置,不是通过bean name, 一个properties 文件就是通过你自己的ViewResolver.这个抽象的model Map 允许你在视图层面完成提取,没有任何的争辩JSP/Velocity或者其他,每一种都可以直接完整使用.这个model Map 还可以简单得得到适当的格式化数据的转换,像JSP 请求属性或者Velocity 模版模式.

4.3集成:用Spring一个不同web 框架

许多开发团队将为他们已有的项目或者新的项目已经获得的期限和工具进行投资.这里没有像Struts那样大量的图书和工具,但是同样我们有大量的拥有Spring开发技巧的开发人员.然而,如果你愿意生活在Struts的构架瑕疵中的话,他将是你在web层开发不错的选择.当然,其他应用也是一样. 如果你不想用Spring的 web MVC ,但是想借用Spring嫁接其他的解决方案,你可以非常简单地通过Spring 继承你自己的web 框架.你可以非常简单地通过ContextLoaderListener 启动一个Spring root application context, 并且,通过Struts 或者WebWork 的action 利用ServletContext 属性(或者Spring 的helper方法)存取它. 值得注意的是, 这里没有任何的 'plugins'被调用,因此没有专门的集成:来自web层的视图, 你可以简单的将Spring作为一个管理application context 实例入口点的类库. 所有你注册bean和Spring服务都可以在不需要Spring的web MVC的情况下都可以被你轻松掌握.Spri

剩余内容已隐藏,支付完成后下载完整资料


资料编号:[499977],资料为PDF文档或Word文档,PDF文档可免费转换为Word

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。