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

 2022-08-22 10:08

JSP and WEB technolog

1 JSP Introduction

JSP (JavaServer 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 fou

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


JSP及其WEB技术

. 1 JSP简介

JSP(JavaServer 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 Structs功能简介

Struts是一个MVC框架(Framework),用于快速开发Java Web应用。Struts实现的重点在C(Controller),包括ActionServlet/RequestProcessor和我们定制的Action,也为V(View)提供了一系列定制标签(Custom Tag)。Spring是一个轻型容器(light-weight container),其核心是Bean工厂(Bean Factory),用以构造我们所需要的M(Model)。在此基础之上,Spring提供了AOP(Aspect-Oriented Programming, 面向层面的编程)的实现,用它来提供非管理环境下申明方式的事务、安全等服务;对Bean工厂的扩展ApplicationContext更加方便我们实现J2EE的应用;DAO/ORM的实现方便我们进行数据库的开发;Web MVC和Spring Web提供了Java Web应用的框架或与其他流行的Web框架进行集成。就是说可将两者一起使用,达到将两者自身的特点进行互补。

Structs 是一组相互协作的类、servlet 和 JSP 标记,它们组成一个可重用的 MVC 2 设计。这个定义表示 Struts 是一个框架,而不是一个库,但 Struts 也包含了丰富的标记库和独立于该框架工作的实用程序类。

Client browser(客户浏览器),来自客户浏览器的每个 HTTP 请求创建一个事件。Web 容器将用一个 HTTP 响应作出响应。  

Controller(控制器),控制器接收来自浏览器的请求,并决定将这个请求发往何处。就 Struts 而言,控制器是以 servlet 实现的一个命令设计模式。 struts-config.xml 文件配置控制器。  

业务逻辑,业务逻辑更新模型的状态,并帮助控制应用程序的流程。就 Struts 而言,这是通过作为实际业务逻辑“瘦”包装的 Action 类完成的。

Model(模型)的状态,模型表示应用程序的状态。业务对象更新应用程序的状态。ActionForm bean 在会话级或请求级表示模型的状态,而不是在持久级。JSP 文件使用 JSP 标记读取来自 ActionForm bean 的信息。

View(视图),视图就是一个 JSP 文件。其中没有流程逻辑,没有业务逻辑,也没有模型信息 -- 只有标记。标记是使 Struts 有别于其他框架(如 Velocity)的因素之一。

Struts 的控制器是将事件(事件通常是 HTTP post)映射到类的一个 servlet.正如您所料 —— 控制器使用配置文件以使您不必对这些值进行硬编码。时代变了,但方法依旧。

Action类,ActionForm 维护 Web 应用程序的会话状态。 ActionForm 是一个抽象类,必须为每个输入表单模型创建该类的子类。当我说 输入表单模型 时,是指 ActionForm 表示的是由 HTML 表单设置或更新的一般意义上的数据。Action类是业务逻辑的一个包装。 Action 类的用途是将 HttpServletRequest 转换为业务逻辑。要使用 Action ,请创建它的子类并覆盖 process() 方法。

ActionServlet (Command) 使用 perform() 方法将参数化的类传递给 ActionForm .仍然没有太多讨厌的 request.getParameter() 调用。当事件进展到这一步时,输入表单数据(或 HTML 表单数据)已被从请求流中提取出来并转移到 ActionForm 类中。

考虑 Action 类的另一种方式是 Adapter 设计模式。 Action 的用途是“将类的接口转换为客户机所需的另一个接口。Adapter 使类能够协同工作,如果没有 Adapter,则这些类会因为不兼容的接口而无法协同工作。”。本例中的客户机是 ActionServlet ,它对我们的具体业务类接口一无所知。因此,Struts 提供了它能够理解的一个业务接口,即 Action .通过扩展 Action ,我们使得我们的业务接口与 Struts 业务接口保持兼容。

5 CSS简介

CSS的编辑方法同HTML一样,也可以是任何文本编辑器或网页编辑软件,还有专门用来编辑CSS的软件。 如果你写的CSS语句是当成外部样式表而在HTML文件中调用,那它的扩展名存成.css就可。当初技术人员想出HTML,主要侧重于定义内容,比如 p表示一个段落,h1表示标题,而并没有过多设计HTML的排版和界面效果。

随着Internet的迅猛发展,HTML被广泛应用,上网的人们当然希望网页做得漂亮些,因此HTML排版和界面效果的局限性日益暴露出来。为了解决这个问题,人们也走了不少弯路,用了一些不好的方法,比如给HTML增加很多的属性结果将代码变得很臃肿,将文本变成图片,过多利用Table来排版,用空白的图片表示白色的空间等。直到CSS出现。

CSS可算是网页设计的一个突破,它解决了网页界面排版的难题。可以这么说,HTML的Tag主要是定义网页的内容(Content),而CSS决定这些网页内容如何显示(Layout)。CSS的英文是Cascading Style Sheets,中文可以翻译成串联式样式表。CSS按其位置可以分成三种:内嵌样式(Inline Style) ,内部样式表(Internal Style Sheet) ,外部样式表(External Style Sheet)。

6 HTML功能简介

Hyper Text Markup Language 超文本标记语言是一种用来制作超文本文档的简单标记语言。用HTML编写的超文本文档称为HTML文档,它能独立于各种操作系统平台(如UNIX,WINDOWS等)。自1990年以来HTML就一直被用作World Wide Web上的信息表示语言,用于描述Homepage的格式设计和它与WWW上其它Homepage的连结信息。

HTML文档(即Homepage的源文件)是一个放置了标记的ASCII文本文件,通常它带有.html或.htm的文件扩展名。生成一个HTML文档主要有以下三种途径:1.手工直接编写(例如用你所喜爱的ASCII文本编辑器或其它HTML的编辑工具)。2.通过某些格式转换工具将现有的其它格式文档(如WORD文档)转换成HTML文档。3.由Web服务器(或称HTTP 服务器)一方实时动态地生成。

HTML语言是通过利用各种标记(tags)来标识文档的结构以及标识超链(Hyperlink)的信息。

虽然HTML语言描述了文档的

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


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

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

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