JSP技术简介(外文翻译)

JSP技术简介(外文翻译)
JSP技术简介(外文翻译)

JSP技术概述

一、JSP的好处

二、JSP页面最终会转换成servler。因而,从根本上,JSP页面能够执

行的任何任务都可以用servler来完成。然而,这种底层的等同性并不意味着servler和JSP页面对于所有的情况都等同适用。问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。毕竟,在特定平台上能够用Java编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要。

和单独使用servler相比,JSP提供下述好处:

三、λJSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML:

没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。

四、λ能够使用标准的网站开发工具。即使对那些对JSP一无所知的

HTML工具,我们也可以使用,因为它们会忽略JSP标签(JSP tags)。

五、λ可以对开发团队进行划分。Java程序员可以致力于动态代码。Web

开发人员可以将经理集中在表示层(presentation layer)上。对于大型的项目,这种划分极为重要。依据开发团队的大小,及项目的复杂程度,可以对静态HTML和动态内容进行弱分离(weaker separation)和强分离(stronger separation)。

六、在此,这个讨论并不是让您停止使用servlets,只使用JSP。几乎

所有的项目都会同时用到这两种技术。针对项目中的某些请求,您可能会在MVC构架下组合使用这两项技术。我们总是希望用适当的工具完成相对应的工作,仅仅是servlet并不能填满您的工具箱。

二、JSP相对于竞争技术的优势

许多年前,Marty受到邀请,参加一个有关软件技术的小型(20个人)研讨会.做在Marty旁边的人是James Gosling--- Java编程语言的发明者。

隔几个位置,是来自华盛顿一家大型软件公司的高级经理。在讨论过程中,研讨会的主席提出了Jini的议题,这在当时是一项新的Java技术.主席向该经理询问他的想法.他继续说,他们会持续关注这项技术,如果这

项技术变得流行起来,他们会遵循公司的“接受并扩充(embrace and extend)”的策略.此时, Gosling随意地插话说“你的意思其实就是不接受且不扩充(disgrace and distend)。”

在此, Gosling的抱怨显示出,他感到这个公司会从其他公司那里拿走技术,用于他们自己的目的.但你猜这次怎么样?这次鞋子穿在了另一只脚上。Java社团没有发明这一思想----将页面设计成由静态HTML和用特殊标签标记的动态代码混合组成.。ColdFusion多年前就已经这样做了。甚至ASP(来自于前述经理所在公司的一项产品)都在JSP出现之前推广了这种方式。实际上,JSP不只采用了这种通用概念,它甚至使用许多和ASP相同的特殊标签。

因此,问题变成:为什么使用JSP,而不使用其他技术呢?我们的第一反应

是我们不是在争论所有的人应该做什么。其他这些技术中,有一些也很不错,在某些情况下也的确是合情合理的选择.然而,在其他情形中,JSP明

显要更好一些。下面给出几个理由。

与.NET和Active Server Pages (ASP)相比

.NET是Microsoft精心设计的一项技术。https://www.360docs.net/doc/0814796969.html,是与servlets和JSP 直接竞争的技术。JSP的优势体现在两个方面。

首先,JSP可以移植到多种操作系统和Web服务器,您不必仅仅局限于部署在Windows 和IIS上尽管核心.NET平台可以在好几种非Windows平台上运行,但ASP这一部分不可以。您不能期望可以将重要的https://www.360docs.net/doc/0814796969.html,应用部署到多种服务器和操作系统。对于某些应用,这种差异没有什么影响。但有些应用,这种差异却非常重要。

其次,对于某些应用,底层语言的选择至关重要。例如,尽管.NET的C#语言设计优良,且和Java类似,但熟悉核心C#语法和众多工具库的程序员很少。此外,许多开发者依旧使用最初版本的ASP。相对于这个版本,JSP 在动态代码方面拥有明显的优势。使用JSP,动态部分是用Java编写的,而非VBScript过其他ASP专有的语言,因此JSP更为强劲,更适合于要求组件重用的复杂应用。

当将JSP与之前版本的ColdFusion对比时,您可能会得到相同的结论。

应用JSP,您可以使用Java编写“真正的代码”,不必依赖于特定的服务器产品。然而,当前版本的ColdFusion满足J2EE服务器的环境,允许开发者容易的混合使用ColdFusion和Servlet/JSP代码。

与PHP相比

PHP(“PHP:Hypertext Preprocessor”的递归字母缩写词)是免费的、开放源代码的、HTML嵌入其中的脚本语言,与ASP和JSP都有某种程度的类似。JSP的一项优势是动态部分用Java编写,而Java已经在联网、数据库访问、分布式对象等方面拥有广泛的API,而PHP需要学习全新的、应用相对广泛的语言。JSP的第二项优势是,和PHP相比,JSP拥有极为广泛的工具和服务器提供商的支持。

与纯Servlet相比

原则上,JSP并没有提供Servlet不能完成的功能。实际上,JSP文档在后台被自动转换成Servlet。但是编写(和修改)常规的HTML,要比无数println语句生成HTML要方便得多。另外,通过将表示与内容分离,可以为不同的人分配不同的任务:网页设计人员使用熟悉的工具构建HTML,要么为Servlet程序员留出空间插入动态内容,要么通过XML标签间接调用动态内容。

这是否表示您只可以学习JSP,将Servlet丢到一边呢?当然不是!由于以下4种原因,JSP开发人员需要了解Servlet:

(1)JSP页面会转换成Servlet。不了解Servlet就无法知道JSP如何工作。

(2)JSP由静态HTML、专用的JSP标签和Java代码组成。哪种类型的Java代码呢?当然是Servlet代码!如果不了解Servlet编程,那么就无法编写这种代码。

(3)一些任务用Servlet完成比用JSP来完成要好。JSP擅长生成由大量组织有序的结构化HTML或其他字符数据组成的页面。Servlet擅长生成二进制数据,构建结构多样的页面,以及执行输出很少或者没有输出的任务(比如重定向)。

(4)有些任务更适合于组合使用Servlet和JSP来完成,而非单独使用

Servlet或JSP。

与JavaScript相比

JavaScript和Java编程语言完全是两码事,前者一般用于在客户端动态生成HTML,在浏览器载入文档时构建网页的部分内容。这是一项有用的功能,一般与JSP的功能(只在服务器端运行)并不发生重叠。和常规HTML页面一样,JSP页面依旧可以包括用于JavaScript的SCRIPT标签。实际上,JSP甚至能够用来动态生成发送到客户端的JavaScript。因此,JavaScript不是一项竞争技术,它是一项补充技术。

JavaScript也可以用在服务器端,最因人注意的是SUN ONE(以前的iPlanet)、IIS和BroadVision服务器。然而,Java更为强大灵活、可靠且可移植。

与WebMacro和Velocity相比

JSP决非完美。许多人都曾指出过JSP中能够改进的功能。这是一件好事,JSP的优势之一是该规范由许多不同公司组成的社团控制。因此,在后续版本中,这项技术能够得到协调的改进。

但是,一些组织已经开发出了基于Java的替代技术,试图弥补这些不足。据我们的判断,这样做是错误的。使用扩充JSP和Servlet技术的第三方工具,如Apache Structs,是一种很好的思路,只要该工具带来的好处能够补偿工具带来的额外复杂性。但是,试图使用非标准的工具代替JSP则不理想。在选择一项技术时,需要权衡许多方面的因素:标准化、可移植性、集成性、行业支持和技术特性。对于JSP替代技术的争论几乎只是集中在技术特性上,而可移植性、标准化和集成性也十分重要。例如,Servlet和JSP规范为Web应用定义了一个标准的目录结构,并提供用于部署Web应用的标准文件(.war文件)。所有JSP兼容的服务器必须支持这些标准。我们可以建立过滤器作用到任意树木的Servlet和JSP页面上,但不能用于非标准资源。Web应用安全设置也同样如此。

此外,业界对JSP和Servlet技术的巨大支持使得这两项技术都有了巨大的进步,从而减轻了对JSP的许多批评。例如,JSP标准标签库和JSP 2.0表达式语言解决了两种最广泛的批评:缺乏良好的迭代结构;不使用

显式的Java代码或冗长的jsp:useBean元素难以访问动态结果。

三、对JSP的误解

忘记JSP技术是服务器端技术

下面是Marty收到的一些典型问题(大部分问题不止一次的出现)。

λ我们的服务器正在运行JDK1.4。我如何将Swing组件用到JSP页面中呢?

我如何将图像放到JSP页面中?我不知道读取图像文件应该使用哪些Javaλ I/O命令。

Tomcat不支持JavaScript,当用户在图像上移动鼠标时,我如何使图像突出显示呢?λ

λ我们的客户使用不理解JSP的旧浏览器。我应该怎么做?

当我们的客户在浏览器中使用“Vi ewλSource”(查看源代码)时,如何阻止他们看到JSP标签?

所有这些问题都基于浏览器对服务器端的过程在有所了解的假定之上。但事实上浏览器并不了解服务器端的过程。因此:

λ如果要将使用Swing组件的applet放到网页中,重要的是浏览器的Java版本,和服务器的Java版本无关。如果浏览器支持Java 2平台,您可以使用正常的APPLET(或Java插件)标签,即使在服务器上使用了非Java技术也须如此。

您不需要JavaλI/O来读取图像文件,您只需将图像放在存储Web资源的目录中(即WEB-INF/classes向上两级的目录),并输出一个正常的IMG标签。

λ您应该用SCRIPT标签,使用客户端JavaScript创建在鼠标下会更改的图像,这不会由于服务器使用JSP而改变。

λ浏览器根本不“支持”JSP----它们看到的只是JSP页面的输出。因此,如同对待静态HTML页面一样,只需确保JSP输出的HTML与浏览器兼容。λ当然,您不需要采取什么措施来阻止客户看到JSP标签,这些标签在服务器上进行处理,发送给客户的输出中并不出现。

混淆转换期间和请求期间

JSP页面需要转换成servlet。Servlet在编译后,载入到服务器的内容中,初始化并执行。但是每一步发生在什么时候呢?要回答这个问题,要记住以下两点:

λJSP页面仅在修改后第一次被访问时,才会被转换成servlet并进行编译;

λ载入到内存中、初始化和执行遵循servlet的一般规则。

表1列出一些常见的情形,讲述在该种情况下每一步是否发生。最常被误解的项已经突出标示出来。在参考该表时,要注意,由JSP页面生成的servlet使用_jspService方法(GET和POST请求都调用该函数),不是doGet或doPost方法。同样,对于初始化,它们使用jspInit方法,而非init方法。

表1 各种情况下的JSP操作

将JSP 页面转换成servlet 编译Servlet 将Servlet 载入到服务器内存中调用jspInit 调用_jspService

页面初次创建

请求 1 有有有有有

请求 2 无无无无有

服务器重启后

请求3 无无有有有

请求 4 无无无无有

页面修改后

请求 5 有有有有有

请求 6 无无无无有

JSP Technical Overview

A, JSP benefits

2, JSP pages will eventually be converted into servler. Thus, fundamentally, JSP pages can perform any task can be used servler to complete. However, this does not mean that the underlying equivalence servler and JSP pages for all conditions are equally applicable. The problem is not technical ability, but both the convenience, productivity and maintainability different. After all, in a particular platform can be done with the Java programming language, things, the same can be done in assembly language, but it is still important to choose which language.

And single use servler compared, JSP provides the following benefits:

3, λ JSP in the HTML, the preparation and maintenance easier. JSP can use regular HTML: no additional backslash, no additional pairs of quotes, and no implied Java syntax.

4, λ can use standard web development tools. Even for those who know nothing about JSP's HTML tools, we can use, because they ignore the JSP tags (JSP tags).

5, λ development team can be divided. Java programmers can engage in dynamic code. Web developers can focus on the manager, said layer (presentation layer) on the. For large projects, this division of paramount importance. Based on the size of the development team, and the complexity of the project can be static HTML and dynamic content for the weak separation of (weaker separation) and strong separation (stronger separation).

6, in this, this discussion does not allow you to stop using servlets, using only JSP. Almost all of the projects will be used both technologies simultaneously. Some of the request for the project, you may be used in combination under the MVC framework of these two techniques. We always want to use the proper tools to complete the corresponding work, only the servlet does not fill up your toolbox.

2, JSP advantage relative to competing technologies

Many years ago, Marty was invited to participate in a software technology related to small (20 individuals) seminar. Do in the next Marty are James Gosling --- Java programming language inventor. Across several locations, is a large software company from Washington, a senior manager. During the discussion, the seminar topics proposed by the Chairman of the Jini, which was a new Java technology. The President to the manager, asked about his thoughts. He went on to say that they will continue to focus the technology, if the technology becomes popular, they will follow the company's "acceptance and expansion (embrace and extend)" strategy. At this point, Gosling casually interjected to say "do you mean actually do not accept and does not expand (disgrace and distend)."

In this, Gosling's complaint shows that he felt that the company will take away from other companies where the technology for their own purposes. But how do you think of this kind? The shoes to wear at the feet of another. Java community did not invent this idea ---- the page designed by a static HTML and the use of a special label marked a mix of dynamic code.. ColdFusion years ago, has already done so. Even ASP (from where the previous manager of the company's one product) are in JSP before the appearance to promote this approach. In fact, JSP not only adopted this general concept, it even use the same special number, and ASP tags.

So the question becomes: Why use JSP, instead of using other technologies? Our first reaction is that we are not arguing about all the people should be done. These other

technologies, there are some very good, in some cases, is indeed a reasonable choice. However, in other cases, JSP is significantly better. Here are a number of reasons.

With. NET and Active Server Pages (ASP) compared to

. NET is Microsoft designed a technology. https://www.360docs.net/doc/0814796969.html, is a direct competition with the servlets and JSP technology. The advantages of JSP is reflected in two aspects.

First of all, JSP can be ported to multiple operating systems and Web servers, you do not have to be limited to be deployed in Windows and IIS on the core though. NET platform can be several non-Windows platforms, but not this part of the ASP. You can expect to be important https://www.360docs.net/doc/0814796969.html, application deployment to multiple servers and operating systems. For certain applications, such differences have little impact. However, some applications, this difference is very important.

Secondly, for some applications, the underlying choice of language is essential. For example, while. NET's C # language design quality, and, and Java is similar, but are familiar with the core of C # syntax and various tools for database programmers rarely. In addition, many developers still use the original version of the ASP. Compared to this version, JSP dynamic code has a clear advantage. The use of JSP, dynamic part is written in Java, rather than VBScript in other ASP proprietary language, so JSP is more robust, more suitable for complex applications require the reuse of components.

When the JSP comparison with previous versions of ColdFusion, you may get the same conclusion. Application JSP, you can use the Java write "real code", do not have to rely on a specific server products. However, the current version of ColdFusion to meet the J2EE server environment that allows developers to easily mix of ColdFusion and Servlet / JSP code. Compared with the PHP

PHP ( "PHP: Hypertext Preprocessor" recursive acronym) is a free, open source, HTML embedded scripting language which, with ASP and JSP are similar to some extent. One advantage of JSP is a dynamic part of the preparation to use Java, but Java has been in networking, database access, distributed objects, etc. have a wide range of API, and PHP need to learn new, application of a relatively wide range of languages. The second advantage of JSP, and PHP comparison, JSP has a very wide range of tools and server providers. Compared with pure Servlet

In principle, JSP and Servlet do not provide the function can not be completed. In fact, JSP documents are automatically converted in the background Servlet. But the writing (and modify) the conventional HTML, than the numerous println statements to generate the HTML easier. In addition, by separating content that can be assigned to different people for different tasks: Web designers to use familiar tools to build HTML, or leave space for Servlet programmers insert dynamic content, or indirectly through the XML tags called dynamic content.

Does this mean that you can only learn JSP, the Servlet threw the side of it? Of course not! For the following four kinds of reasons, JSP developers need to understand the Servlet:

(1) JSP page is converted into a Servlet. Servlet can not know JSP do not understand how they work.

(2) JSP from a static HTML, special JSP tags and Java code. What type of Java code to do? Servlet code of course! If you do not understand the Servlet programming, you can not write this code.

(3) The number of tasks completed with the Servlet to perform better than using JSP. JSP is

generated by a large number of well organized and good at the structure of HTML or any other character data consisting of the page. Servlet good at generating binary data, building structure, a variety of pages, as well as the implementation of the output with little or no output task (for example, redirection).

(4) Some tasks are more suited to be used in combination Servlet and JSP to complete, rather than alone Servlet or JSP.

Compared with the JavaScript

JavaScript and Java programming language are two different things, the former are generally used for the client dynamically generate HTML, the browser load a document to build part of a page. This is a useful function, general and JSP functionality (only running on the server side) does not overlap. Like conventional HTML pages, JSP pages can still include the SCRIPT tag for JavaScript. In fact, JSP or even can be used to dynamically generate to send to the client JavaScript. Thus, JavaScript is not a competing technology, it is a complementary technology. JavaScript can also be used on the server side, the most individualized attention is SUN ONE (former iPlanet), IIS, and BroadVision server. However, Java is more powerful, flexible, reliable and portable.

Compared with the WebMacro and Velocity

JSP by no means perfect. Many people have pointed out in the JSP can be improved features. This is a good thing, JSP's strengths is the specification of many different companies controlled societies. Thus, in subsequent versions, this technology can be improved co-ordination.

However, some organizations have developed a Java-based alternative technologies to try to fill these gaps. According to our judgments, this is wrong. JSP and Servlet technologies using the expansion of third-party tools, such as Apache Structs, is a good idea, as long as the benefits of the tool to compensate for the additional complexity of the tool. However, the attempt to use non-standard tools to replace the JSP is not ideal. In selecting a technology, you need to weigh a number of factors: standardization, portability, integration, industry support and technical characteristics. JSP alternative technologies for the debate almost exclusively focused on the technical characteristics, while portability, standardization, and integration is also important. For example, Servlet and JSP specification defines a standard Web application directory structure, and provides for the deployment of Web applications, standard file (. War files). JSP is compatible with all servers must support these standards. We can create filters to any trees in the role of Servlet and JSP page, but not for non-standard resources. Web application security settings are the same.

In addition, the industry's JSP and Servlet technology, the tremendous support of these two technologies have made tremendous progress, thereby reducing many of the criticisms of the JSP. For example, JSP Standard Tag Library, and JSP 2.0 expression language to solve the two of the most widespread criticism: the lack of good iterative structure; do not use explicit Java code or a lengthy jsp: useBean element difficult to access the dynamic results.

Third, the misunderstanding of the JSP

Forget JSP technology is a server-side technology

Here are some typical problems Marty received (most of the issues appear more than once). λ Our servers are running JDK1.4. How do I use the Swing components JSP pages as well? How do I put an image in JSP pages? I do not know what to read image file should use Java λ

I / O commands.

Tomcat does not support JavaScript, when the user moves the mouse over the image, how can I make the image highlight it? λ

λ Our customers do not understand the JSP to use the old browser. How should I do?

When our client in the browser using the "View λ Source" (view source code), how to stop them see the JSP Tag?

All of these issues are based on the browser to the server-side process in an informed assumption. But in fact the browser does not understand the server-side process. Therefore: λIf you want to use Swing components applet into the page, it is important that the Java version of the browser and the Java version of the server has nothing to do. If the browser supports Java 2 platform, you can use the normal APPLET (or the Java plug-in) label, even if the server using a non-Java technologies should also be the case.

You do not need Java λ I / O to read the image file, you only need to store images on Web directory of resources (ie, up 2 WEB-INF/classes directory), and outputs a normal IMG tag.

λ You should use the SCRIPT tag, use the client-side JavaScript to create under the mouse will change the image, this does not change because the server using JSP.

λ browser does not "support" JSP ---- they only see the JSP page output. Thus, as with static HTML pages, like, just ensure that the JSP output of HTML and browser compatibility.

λ Of course, you do not need to take measures to prevent customers see JSP label, the labels on the server for processing, sent to the customer's output did not arise.

Confusion during the conversion period and the request

JSP pages need to convert into a servlet. In the compiled Servlet, load content to the server, initialize and execute. But every step of what happened when? To answer this question, we must remember the following two points:

λ JSP page is only in the revised first time visit, will be converted into a servlet and compile; λloaded into memory, initialization and implementation of the servlet to follow the general rules.

Table 1 lists some common situations, about the kinds of circumstances has occurred at each step. The most commonly misunderstood items marked have been highlighted. In reference to the table, we should note that the servlet generated by the JSP page using _jspService methods (GET and POST requests are calling the function), is not a doGet or doPost method. Similarly, for initialization, they use jspInit method, rather than the init method.

Table 1 of the JSP operate a variety of situations

JSP pages into servlet will compile Servlet to Servlet loaded into server memory to call jspInit call _jspService

Page first created

Request a Yes Yes Yes Yes Yes

2 No No No No requests have

After the server restart

Request 3 No No Yes Yes Yes

4 No No No No requests have

Page modified

Request 5 Yes Yes Yes Yes Yes

6 No No No No requests have

JSP技术简介及特点——外文翻译

JSP Technology Conspectus And Specialties By:Kathy Sierra and Bert Bates Source: Servlet&JSP The JSP (Java Server mix) technology is used by the Sun microsystem issued by the company to develop dynamic Web application technology. With its easy, cross-platform, in many dynamic Web application programming languages, in a short span of a few years, has formed a complete set of standards, and widely used in electronic commerce, etc. In China, the JSP now also got more extensive attention, get a good development, more and more dynamic website to JSP technology. The related technologies of JSP are briefly introduced. The JSP a simple technology can quickly and with the method of generating Web pages. Use the JSP technology Web page can be easily display dynamic content. The JSP technology are designed to make the construction based on Web applications easier and efficient, and these applications and various Web server, application server, the browser and development tools work together. The JSP technology isn't the only dynamic web technology, also not the first one, in the JSP technology existed before the emergence of several excellent dynamic web technology, such as CGI, ASP, etc. With the introduction of these technologies under dynamic web technology, the development and the JSP. Technical JSP the development background and development history In web brief history, from a world wide web that most of the network information static on stock transactions evolution to acquisition of an operation and infrastructure. In a variety of applications, may be used for based on Web client, look no restrictions. Based on the browser client applications than traditional based on client/server applications has several advantages. These benefits include almost no limit client access and extremely simplified application deployment and management (to update an application, management personnel only need to change the program on a server, not thousands of installation in client applications). So, the software industry is rapidly to build on the client browser multi-layer application. The rapid growth of exquisite based Web application requirements development of technical improvements. Static HTML to show relatively static content is right choice, The new challenge is to create the interaction based on Web applications, in these procedures, the

JSP技术简介(外文翻译)

JSP技术概述 一、JSP的好处 二、JSP页面最终会转换成servler。因而,从根本上,JSP页面能够执 行的任何任务都可以用servler来完成。然而,这种底层的等同性并不意味着servler和JSP页面对于所有的情况都等同适用。问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。毕竟,在特定平台上能够用Java编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要。 和单独使用servler相比,JSP提供下述好处: 三、λJSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML: 没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。 四、λ能够使用标准的网站开发工具。即使对那些对JSP一无所知的 HTML工具,我们也可以使用,因为它们会忽略JSP标签(JSP tags)。 五、λ可以对开发团队进行划分。Java程序员可以致力于动态代码。Web 开发人员可以将经理集中在表示层(presentation layer)上。对于大型的项目,这种划分极为重要。依据开发团队的大小,及项目的复杂程度,可以对静态HTML和动态内容进行弱分离(weaker separation)和强分离(stronger separation)。 六、在此,这个讨论并不是让您停止使用servlets,只使用JSP。几乎 所有的项目都会同时用到这两种技术。针对项目中的某些请求,您可能会在MVC构架下组合使用这两项技术。我们总是希望用适当的工具完成相对应的工作,仅仅是servlet并不能填满您的工具箱。 二、JSP相对于竞争技术的优势 许多年前,Marty受到邀请,参加一个有关软件技术的小型(20个人)研讨会.做在Marty旁边的人是James Gosling--- Java编程语言的发明者。 隔几个位置,是来自华盛顿一家大型软件公司的高级经理。在讨论过程中,研讨会的主席提出了Jini的议题,这在当时是一项新的Java技术.主席向该经理询问他的想法.他继续说,他们会持续关注这项技术,如果这

外文文献及翻译----Servlet和JSP技术简述

毕业设计(论文) 外文文献翻译 专业 学生姓名 班级 学号 指导教师 XX 学院

外文资料名称:An Overview of Servlet and JSP Technology 外文资料出处:Internet 附件: 1.外文资料翻译译文 2.外文原文 指导教师评语: 签名: 年月日

Servlet和JSP技术简述 Nagle and Wiegley XX译 摘要:Servlet程序在服务器端运行,动态地生成Web页面与传统的CGI和许多其他类似CGI的技术相比,Java Servlet具有更高的效率,更容易使用,功能更强大,具有更好的可移植性,更节省投资。 关键字:JSP技术,Servlet,HTTP服务 1.1Servlet的功能 Servlets是运行在Web或应用服务器上的Java程序,它是一个中间层,负责连接来自Web浏览器或其他HTTP客户程序的请求和HTTP服务器上的数据库或应用程序。Servlet的工作是执行西门的任务,如图1.1所示。 图1.1Web中间件的作用 (1)读取客户发送的显式数据。 最终用户一般在页面的HTML表单中输入这些数据。然而,数据还有可能来自applet或定制的HTTP客户程序。 (2)读取由浏览器发送的隐式请求数据。 图1.1中显示了一条从客户端到Web服务器的单箭头,但实际上从客户端传送到Web服务器的数据有两种,它们分别为用户在表单中输入的显式数据,以及后台的HTTP信息。两种数据都很重要。HTTP信息包括cookie、浏览器所能识别的媒体类型和压缩模式等。 (3)生成结果。 这个过程可能需要访问数据库、执行RMI或EJB调用、调用Web服务,或者直接计算得出对应的响应。实际的数据可能存储在关系型数据库中。该数据库可能不理解HTTP,或者不能返回HTML形式的结果,所有Web浏览器不能直接与数据库进行会话。即使它能够做到这一点,为了安全上的考虑,我们也不希望让它这么做。对应大多数

jsp介绍外文翻译

外文原文 JSP JSP (JavaServer 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 secure, mainly for all the characteristics of the Internet. JavaScript, which is completely distinct from the Java programming language, is normally used to dynamically generate HTML on the client, building parts of the Web

毕业设计JSP MVC外文翻译

Struts——一种开源MVC的实现 这篇文章介绍Struts,一个使用servlet和JavaServer Pages技术的一种Model-View-Controller的实现。Struts可以帮助你控制Web项目中的变化并提高专业化。即使你可能永远不会用Struts实现一个系统,你可以获得一些想法用于你未来的servlet和JSP网页的实现中。 简介 在小学校园里的小孩子们都可以在因特网上发布HTML网页。然而,有一个重大的不同在一个小学生和一个专业人士开发的网站之间。网页设计师(或者HTML开发人员)必须理解颜色、用户、生产流程、网页布局、浏览器兼容性、图像创建、JavaScript等等。设计漂亮的网站需要做大量的工作,大多数Java开发人员更注重创建优美的对象接口,而不是用户界面。JavaServer Pages(JSP)技术为网页设计人员和Java开发人员提供了一种联系钮带。 如果你开发过大型Web应用程序,你就理解“变化”这个词语。“模型-视图-控制器”(MVC)就是用来帮助你控制变化的一种设计模式。MVC减弱了业务逻辑接口和数据接口之间的耦合。Struts是一种MVC实现,它将Servlet2.2和JSP 1.1标记(属于J2EE规范)用作实现的一部分。你可能永远不会用Struts实现一个系统,但了解一下Struts或许使你能将其中的一些思想用于你以后的Servlet和JSP实现中。 模型-视图-控制器(MVC) JSP标签只解决了我们问题中的一部分。我们依然有验证、流控制、以及更新应用程序结构的问题。这就是MVC从哪儿来以及来干嘛的。MVC通过把问题分成三类来帮助解决一些与单模块相关的问题: ?Model(模型) 模块包括应用程序功能的核心。模型封装着应用程序的各个结构。有时它所包含的唯一功能就是结构。它对于视图或者控制器一无所知。 ?View(视图) 视图提供了模型的演示。它是应用程序的外表。视图可以进入模型获得者,

JSP应用框架外文翻译

中文4816字 外文资料翻译 (2011 届大学本科)题目: 学院: 专业: 班级: 姓名: 学号: 主指导教师: 2011年02 月24 日 教务处印制

外文原文 JSP application frameworks brian wright、michael freedman https://www.360docs.net/doc/0814796969.html,/pdf/introduction-to-machine-learning/ What are application frameworks: A framework is a reusable, semi-complete application that can be specialized to produce custom applications [Johnson]. Like people, software applications are more alike than they are different. They run on the same computers, expect input from the same devices, output to the same displays, and save data to the same hard disks. Developers working on conventional desktop applications are accustomed to toolkits and development environments that leverage the sameness between applications. Application frameworks build on this common ground to provide developers with a reusable structure that can serve as the foundation for their own products. A framework provides developers with a set of backbone components that have the following characteristics: 1.They are known to work well in other applications. 2. They are ready to use with the next project. 3. They can also be used by other teams in the organization. Frameworks are the classic build-versus-buy proposition. If you build it, you will understand it when you are done—but how long will it be before you can roll your own? If you buy it, you will have to climb the learning curve—and how long is that going to take? There is no right answer here, but most observers would agree that frameworks such as Struts provide a significant return on investment compared to starting from scratch, especially for larger projects. Other types of frameworks: The idea of a framework applies not only to applications but to application componentsas well. Throughout this article, we introduce other types of frameworks that you can use with Struts. These include the Lucene search engine, the Scaffold toolkit, the Struts validator, and the Tiles tag library. Like application frameworks, these tools provide semi-complete versions of a subsystem that can be specialized to

外文文献 JSP 毕业设计

THE TECHNIQUE DEVELOPMENT HISTORY OF JSP By:Kathy Sierra and Bert Bates Source:Servlet&JSP The Java Server Pages( JSP) is a kind of according to web of the script plait distance technique, similar carries the script language of Java in the server of the Netscape company of server- side JavaScript( SSJS) and the Active Server Pages(ASP) of the Microsoft. JSP compares the SSJS and ASP to have better can expand sex, and it is no more exclusive than any factory or some one particular server of Web. Though the norm of JSP is to be draw up by the Sun company of, any factory can carry out the JSP on own system. The After Sun release the JSP( the Java Server Pages) formally, the this kind of new Web application development technique very quickly caused the people's concern. JSP provided a special development environment for the Web application that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, IIS4.0 on the market at inside of 85% server product. This chapter will introduce the related knowledge of JSP and Databases, and JavaBean related contents, is all certainly rougher introduction among them basic contents, say perhaps to is a Guide only, if the reader needs the more detailed information, pleasing the book of consult the homologous JSP. 1.1 GENERALIZE The JSP(Java Server Pages) is from the company of Sun Microsystems initiate, the many companies the participate to the build up the together of the a kind the of dynamic the state web the page technique standard, the it have the it in the construction the of the dynamic state the web page the strong but the do not the especially of the function. JSP and the technique of ASP of the Microsoft is very alike. Both all provide the ability that mixes with a certain procedure code and is explain by the language engine to carry out the procedure code in the code of HTML. Underneath we are simple of carry on the introduction to it. JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matters which you choose.

JSP技术中英文对照外文翻译文献

(文档含英文原文和中文翻译) 中英文对照外文翻译 JSP技术 Java Server Pages(JSP)是一种基于web的脚本编程技术,类似于网景公司的

服务器端Java脚本语言—— server-side JavaScript(SSJS)和微软的Active Server Pages(ASP)。与SSJS和ASP相比,JSP具有更好的可扩展性,并且它不专属于任何一家厂商或某一特定的Web服务器。尽管JSP规范是由Sun公司制定的,但任何厂商都可以在自己的系统上实现JSP。 在Sun正式发布JSP(Java Server Pages)之后,这种新的Web应用开发技术很快引起了人们的关注。JSP为创建高度动态的Web应用提供了一个独特的开发环境。按照Sun的说法,JSP能够适应市场上包括Apache WebServer、IIS4.0在内的85%的服务器产品。 本文将介绍JSP相关的知识,以及JavaBean的相关内容,当然都是比较粗略的介绍其中的基本内容,仅仅起到抛砖引玉的作用,如果读者需要更详细的信息,请参考相应的JSP的书籍。 1.1 概述 JSP(Java Server Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准,其在动态网页的建设中有其强大而特别的功能。JSP与Microsoft的ASP技术非常相似。两者都提供在HTML代码中混合某种程序代码、由语言引擎解释执行程序代码的能力。下面我们简单的对它进行介绍。 JSP页面最终会转换成servlet。因而,从根本上,JSP页面能够执行的任何任务都可以用servlet来完成。然而,这种底层的等同性并不意味着servlet和JSP 页面对于所有的情况都等同适用。问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。毕竟,在特定平台上能够用Java编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要。 和单独使用servlet相比,JSP提供下述好处: JSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML:没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。 能够使用标准的网站开发工具。即使是那些对JSP一无所知的HTML工具,我们也可以使用,因为它们会忽略JSP标签(JSP tags)。 可以对开发团队进行划分。Java程序员可以致力于动态代码。Web开发人员可以将精力集中在表示层(presentation layer)上。对于大型的项目,这种划分极为重要。依据开发团队的大小,及项目的复杂程度,可以对静态HTML和动态内容

JSP技术外文翻译

翻译资料原文 Overview of JSP Technology Benefits of JSP JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matters which you choose. JSP provides the following benefits over servlets alone: ? It is easier to write and maintain the HTML. Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax. ? You can use standard Web-site development tools. Even HTML tools that know nothing about JSP can be used because they simply ignore the JSP tags. ? You can divide up your development team. The Java programmers can work on the dynamic code. The Web developers can concentrate on the presentation layer. On large projects, this division is very important. Depending on the size of your team and the complexity of your project, you can enforce a weaker or stronger separation between the static HTML and the dynamic content. Now, this discussion is not to say that you should stop using servlets and use only JSP instead. By no means. Almost all projects will use both. For some requests in your project, you will use servlets. For others, you will use JSP. For still others, you will combine them with the MVC architecture . You want the appropriate tool for the job, and servlets, by themselves, do not complete your toolkit. Advantages of JSP Over Competing Technologies A number of years ago, Marty was invited to attend a small 20-person industry roundtable discussion on software technology. Sitting in the seat next to Marty was James Gosling, inventor of the Java programming language. Sitting several seats away was a high-level manager from a

JSP外文翻译

JSP简介 JSP(JavaServer Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准。JSP技术有点类似ASP技术,它是在传统的网页HTML文件(*.htm,*.html)中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件(*.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规范。目前较新的是JSP1.2规范,JSP2.0规范的征求意见稿也已出台。 JSP页面由HTML代码和嵌入其中的Java代码所组成。服务器在页面被客户端请求以后对这些Java代码进行处理,然后将生成的HTML页面返回给客户端的浏览器。Java Servlet 是JSP的技术基础,而且大型的Web应用程序的开发需要Java Servlet和JSP配合才能完成。JSP具备了Java技术的简单易用,完全的面向对象,具有平台无关性且安全可靠,主要面向因特网的所有特点。 JSP技术的强势 (1)一次编写,到处运行。在这一点上Java比PHP更出色,除了系统之外,代码不用做任何更改。 (2)系统的多平台支持。基本上可以在所有平台上的任意环境中开发,在任意环境中进行系统部署,在任意环境中扩展。相比ASP/PHP的局限性是显而易见的。

JSP外文翻译

附件1:外文资料翻译译文 Struts——一种开源MVC的实现 这篇文章介绍Struts,一个使用servlet 和JavaServer Pages 技术的一种Model-View-Controller 的实现。Struts 可以帮助你控制Web 项目中的变化并提高专业化。即使你可能永远不会用Struts实现一个系统,你可以获得一些想法用于你未来的servlet 和JSP 网页的实现中。 简介 在小学校园里的小孩子们都可以在因特网上发布HTML 网页。然而,有一个重大的不同在一个小学生和一个专业人士开发的网站之间。网页设计师(或者HTML开发人员)必须理解颜色、用户、生产流程、网页布局、浏览器兼容性、图像创建、JavaScript 等等。设计漂亮的网站需要做大量的工作,大多数Java 开发人员更注重创建优美的对象接口,而不是用户界面。JavaServer Pages (JSP) 技术为网页设计人员和Java 开发人员提供了一种联系钮带。 如果你开发过大型Web 应用程序,你就理解“变化”这个词语。“模型-视图-控制器”(MVC) 就是用来帮助你控制变化的一种设计模式。MVC 减弱了业务逻辑接口和数据接口之间的耦合。Struts 是一种MVC 实现,它将Servlet 2.2 和JSP 1.1 标记(属于J2EE 规范)用作实现的一部分。你可能永远不会用Struts 实现一个系统,但了解一下Struts 或许使你能将其中的一些思想用于你以后的Servlet和JSP 实现中。 模型-视图-控制器 (MVC) JSP标签只解决了我们问题中的一部分。我们依然有验证、流控制、以及更新应用程序结构的问题。这就是MVC从哪儿来以及来干嘛的。MVC通过把问题分成三类来帮助解决一些与单模块相关的问题:

外文翻译-----JSP简介

JSP Open Category: WEB, JAVA, dynamic pages, the Knowledge Network Contents ? JSP Profile ? JSP technology strength ? JSP technology vulnerable ? JSP six built-in objects: ? JSP dynamic web site development and technology JSP Profile JSP (JavaServer 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.

相关主题
相关文档
最新文档