文档库 最新最全的文档下载
当前位置:文档库 › java外文资料翻译资料

java外文资料翻译资料

java外文资料翻译资料
java外文资料翻译资料

*** 学院

毕业设计(论文)外文资料翻译

系(院):计算机工程学院

专业:计算机科学与技术(软件技术)姓名:***

学号:***

外文出处:The Programmer

(用外文写)

附件: 1.外文资料翻译译文;2.外文原文。

注:请将该封面与附件装订成册。

附件1:外文资料翻译译文

JSP技术概述

JSP的优点

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

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

(1)JSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML:没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。

(2)能够使用标准的网站开发工具。即使对那些对JSP一无所知的HTML 工具,我们也可以使用,因为它们会忽略JSP标签(JSP tags)。

(3)可以对开发团队进行划分。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.wendangku.net/doc/7818248229.html,是与servlets和JSP直接竞争的技术。JSP的优势体现在两个方面。

首先,JSP可以移植到多种操作系统和Web服务器,您不必仅仅局限于部署在Windows 和IIS上尽管核心.NET平台可以在好几种非Windows平台上运行,但ASP这一部分不可以。您不能期望可以将重要的https://www.wendangku.net/doc/7818248229.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的旧浏览器。我应该怎么做?

当我们的客户在浏览器中使用“Viewλ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的一般规则。

附件2:外文原文(复印件)

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 very large software company in Redmond, Washington. During the discussion, the moderator brought up the subject of Jini, which at that time was a new Java technology. The moderator asked the manager what he thought of it, and the manager responded that it was too early to tell, but that it seemed to be an excellent idea. He went on to say that they would keep an eye on it, and if it seemed to be catching on, they would follow his company's usual "embrace and extend" strategy. At this point, Gosling lightheartedly interjected "You mean disgrace and distend."

Now, the grievance that Gosling was airing was that he felt that this company would take technology from other companies and suborn it for their own purposes. But guess what? The shoe is on the other foot here. The Java community did not invent the idea of designing pages as a mixture of static HTML and dynamic code marked with special tags. For example, ColdFusion did it years earlier. Even ASP (a product from the very software company of the aforementioned manager) popularized this approach before JSP came along and decided to jump on the bandwagon. In fact, JSP not only adopted the general idea, it even used many of the same special tags as ASP did.

So, the question becomes: why use JSP instead of one of these other technologies? Our first response is that we are not arguing that everyone should. Several of those other technologies are quite good and are reasonable options in some situations. In other situations, however, JSP is clearly better. Here are a few of the reasons.

Versus .NET and Active Server Pages (ASP)

.NET is well-designed technology from Microsoft. https://www.wendangku.net/doc/7818248229.html, is the part that directly competes with servlets and JSP. The advantages of JSP are twofold.

First, JSP is portable to multiple operating systems and Web servers; you aren't locked into deploying on Windows and IIS. Although the core .NET platform runs on a few non-Windows platforms, the ASP part does not. You cannot expect to deploy serious https://www.wendangku.net/doc/7818248229.html, applications on multiple servers and operating systems. For some applications, this difference does not matter. For others, it matters greatly.

Second, for some applications the choice of the underlying language matters greatly. For example, although .NET's C# language is very well designed and is similar to Java,

fewer programmers are familiar with either the core C# syntax or the many auxiliary libraries. In addition, many developers still use the original version of ASP. With this version, JSP has a clear advantage for the dynamic code. With JSP, the dynamic part is written in Java, not VBScript or another ASP-specific language, so JSP is more powerful and better suited to complex applications that require reusable components.

You could make the same argument when comparing JSP to the previous version of ColdFusion; with JSP you can use Java for the "real code" and are not tied to a particular server product. However, the current release of ColdFusion is within the context of a J2EE server, allowing developers to easily mix ColdFusion and servlet/JSP code.

Versus PHP

PHP (a recursive acronym for "PHP: Hypertext Preprocessor") is a free, open-source, HTML-embedded scripting language that is somewhat similar to both ASP and JSP. One advantage of JSP is that the dynamic part is written in Java, which already has an extensive API for networking, database access, distributed objects, and the like, whereas PHP requires learning an entirely new, less widely used language. A second advantage is that JSP is much more widely supported by tool and server vendors than is PHP.

Versus Pure Servlets

JSP doesn't provide any capabilities that couldn't, in principle, be accomplished with servlets. In fact, JSP documents are automatically translated into servlets behind the scenes. But it is more convenient to write (and to modify!) regular HTML than to use a zillion println statements to generate the HTML. Plus, by separating the presentation from the content, you can put different people on different tasks: your Web page design experts can build the HTML by using familiar tools and either leave places for your servlet programmers to insert the dynamic content or invoke the dynamic content indirectly by means of XML tags.

Does this mean that you can just learn JSP and forget about servlets? Absolutely not! JSP developers need to know servlets for four reasons:

1. JSP pages get translated into servlets. You can't understand how JSP works without understanding servlets.

2. JSP consists of static HTML, special-purpose JSP tags, and Java code. What kind

of Java code? Servlet code! You can't write that code if you don't understand servlet programming.

3. Some tasks are better accomplished by servlets than by JSP. JSP is good at generating pages that consist of large sections of fairly well structured HTML or other character data. Servlets are better for generating binary data, building pages with highly variable structure, and performing tasks (such as redirection) that involve little or no output.

4. Some tasks are better accomplished by a combination of servlets and JSP than by either servlets or JSP alone.

Versus JavaScript

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 page as the browser loads the document. This is a useful capability and does not normally overlap with the capabilities of JSP (which runs only on the server). JSP pages still include SCRIPT tags for JavaScript, just as normal HTML pages do. In fact, JSP can even be used to dynamically generate the JavaScript that will be sent to the client. So, JavaScript is not a competing technology; it is a complementary one.

It is also possible to use JavaScript on the server, most notably on Sun ONE (formerly iPlanet), IIS, and BroadVision servers. However, Java is more powerful, flexible, reliable, and portable.

Versus WebMacro or Velocity

JSP is by no means perfect. Many people have pointed out features that could be improved. This is a good thing, and one of the advantages of JSP is that the specification is controlled by a community that draws from many different companies. So, the technology can incorporate improvements in successive releases.

However, some groups have developed alternative Java-based technologies to try to address these deficiencies. This, in our judgment, is a mistake. Using a third-party tool like Apache Struts that augments JSP and servlet technology is a good idea when that tool adds sufficient benefit to compensate for the additional complexity. But using a nonstandard tool that tries to replace JSP is a bad idea. When choosing a technology, you

need to weigh many factors: standardization, portability, integration, industry support, and technical features. The arguments for JSP alternatives have focused almost exclusively on the technical features part. But portability, standardization, and integration are also very important. For example, the servlet and JSP specifications define a standard directory structure for Web applications and provide standard files (.war files) for deploying Web applications. All JSP-compatible servers must support these standards. Filters can be set up to apply to any number of servlets or JSP pages, but not to nonstandard resources. The same goes for Web application security settings.

Besides, the tremendous industry support for JSP and servlet technology results in improvements that mitigate many of the criticisms of JSP. For example, the JSP Standard Tag Library and the JSP 2.0 expression language address two of the most well-founded criticisms: the lack of good iteration constructs and the difficulty of accessing dynamic results without using either explicit Java code or verbose jsp:useBean elements.

10.4 Misconceptions About JSP

Forgetting JSP Is Server-Side Technology

Here are some typical questions Marty has received (most of them repeatedly).

? Our server is running JDK 1.4. So, how do I put a Swing component in a JSP page?

? How do I put an image into a JSP page? I do not know the proper Java I/O commands to read image files.

? Since Tomcat does not support JavaScript, how do I make images that are highlighted when the user moves the mouse over them?

? Our clients use older browsers that do not understand JSP. What should we do?

? When our clients use "View Source" in a browser, how can I prevent them from seeing the JSP tags?

All of these questions are based upon the assumption that browsers know something about the server-side process. But they do not. Thus:

? For putting applets with Swing components into Web pages, what matters is the browser's Java version—the server's version is irrelevant. If the browser supports the Java 2 platform, you use the normal APPLET (or Java plug-in) tag and would do so even

if you were using non-Java technology on the server.

? You do not need Jav a I/O to read image files; you just put the image in the directory for Web resources (i.e., two levels up from WEB-INF/classes) and output a normal IMG tag.

? You create images that change under the mouse by using client-side JavaScript, referenced with the SCRIPT tag; this does not change just because the server is using JSP.

? Browsers do not "support" JSP at all—they merely see the output of the JSP page. So, make sure your JSP outputs HTML compatible with the browser, just as you would do with static HTML pages.

? And, of course you need not do anything to prevent clients from seeing JSP tags; those tags are processed on the server and are not part of the output that is sent to the client.

Confusing Translation Time with Request Time

A JSP page is converted into a servlet. The servlet is compiled, loaded into the server's memory, initialized, and executed. But which step happens when? To answer that question, remember two points:

? The JSP page is translated into a servlet and compiled only the first time it is accessed after having been modified.

? Loading into memory, initialization, and execution follow the normal rules for servlets.

Table 1 gives some common scenarios and tells whether or not each step occurs in that scenario. The most frequently misunderstood entries are highlighted. When referring to the table, note that servlets resulting from JSP pages use the _jspService method (called for both GET and POST requests), not doGet or doPost. Also, for initialization, they use the jspInit method, not the init method.

Table 1. JSP Operations in Various Scenarios

JSP page translated into servlet Servlet compiled Servlet loaded into server's memory jspInit called _jspService called

外文翻译java

外文资料译文及原文 Java Java I/O 系统 对编程语言的设计者来说,创建一套好的输入输出(I/O)系统,是一项难度极高的任务。 这一点可以从解决方案的数量之多上看出端倪。这个问题难就难在它要面对的可能性太多了。不仅是因为有那么多I/O的源和目地(文件,控制台,网络连接等等),而且还有很多方法(顺序的『sequential』,随机的『random-access』,缓存的『buffered』,二进制的『binary』,字符方式的『character』,行的『by lines』,字的『by words』,等等)。 Java类库的设计者们用"创建很多类"的办法来解决这个问题。坦率地说Java I/O系统的类实在是太多了,以至于初看起来会把人吓着(但是,具有讽刺意味的是,这种设计实际上是限制了类的爆炸性增长)。此外,Java在1.0版之后又对其I/O类库作了重大的修改,原先是面向byte的,现在又补充了面向Unicode字符的类库。为了提高性能,完善功能,JDK 1.4又加了一个nio(意思是"new I/O"。这个名字会用上很多年)。这么以来,如果你想对Java的I/O 类库有个全面了解,并且做到运用自如,你就得先学习大量的类。此外,了解 I/O类库的演化的历史也是相当重要的。可能你的第一反应是"别拿什么历史来烦我了,告诉我怎么用就可以了!"但问题是,如果你对这段历史一无所知,很快就会被一些有用或是没用的类给搞糊涂了。

本章会介绍Java标准类库中的各种I/O类,及其使用方法。 File 类 在介绍直接从流里读写数据的类之前,我们先介绍一下处理文件和目录的类。 File类有一个极具欺骗性的名字;或许你会认为这是一个关于文件的类,但它不是。你可以用它来表示某个文件的名字,也可以用它来表示目录里一组文件的名字。如果它表示的是一组文件,那么你还可以用list( )方法来进行查询,让它会返回String数组。由于元素数量是固定的,因此数组会比容器更好一些。如果你想要获取另一个目录的清单,再建一个File对象就是了。实际上,叫它"FilePath"可能会更好一些。下面我们举例说明怎样使用这个类及其相关的FilenameFilter接口。 目录列表器 假设你想看看这个目录。有两个办法。一是不带参数调用list( )。它返回的是File对象所含内容的完整清单。但是,如果你要的是一个"限制性列表(restricted list)"的话——比方说,你想看看所有扩展名为.java的文件——那么你就得使用"目录过滤器"了。这是一个专门负责挑选显示File对象的内容的类。 下面就是源代码。看看,用了java.utils.Arrays.sort( )和11章的AlphabeticComparator之后,我们没费吹灰之力就对结果作了排序(按字母顺序): //: c12:DirList.java // Displays directory listing using regular expressions. // {Args: "D.*\.java"} import java.io.*; import java.util.*; import java.util.regex.*; import com.bruceeckel.util.*; public class DirList { public static void main(String[] args) { File path = new File("."); String[] list; if(args.length == 0) list = path.list(); else list = path.list(new DirFilter(args[0])); Arrays.sort(list, new AlphabeticComparator());

JAVA外文文献+翻译

Java and the Internet If Java is, in fact, yet another computer programming language, you may question why it is so important and why it is being promoted as a revolutionary step in computer programming. The answer isn’t immediately obvious if you’re coming from a traditional programming perspective. Although Java is very useful for solving traditional stand-alone programming problems, it is also important because it will solve programming problems on the World Wide Web. 1.Client-side programming The Web’s in itial server-browser design provided for interactive content, but the interactivity was completely provided by the server. The server produced static pages for the client browser, which would simply interpret and display them. Basic HTML contains simple mechanisms for data gathering: text-entry boxes, check boxes, radio boxes, lists and drop-down lists, as well as a button that can only be programmed to reset the data on the form or “submit” the data on the form back to the server. This submission passes through the Common Gateway Interface (CGI) provided on all Web servers. The text within the submission tells CGI what to do with it. The most common action is to run a program located on the server in a directory that’s typically called “cgi-bin.” (If you watch the address window at the top of your browser when you push a button on a Web page, you can sometimes see “cgi-bin” within all the gobbledygook there.) These programs can be written in most languages. Perl is a common choice because it is designed for text manipulation and is interpreted, so it can be installed on any server regardless of processor or operating system. Many powerful Web sites today are built strictly on CGI, and you can in fact do nearly anything with it. However, Web sites built on CGI programs can rapidly become overly complicated to maintain, and there is also the problem of response time. The response of a CGI program depends on how much data must

JAVA外文文献翻译基于Java技术的Web应用设计模型的比较研究

中文翻译 基于Java技术的Web应用设计模型的比较研究 来源:School of Computer Science and Engineering University of New South Wales Sydney, NSW 2052, Australia 作者:Budi Kurniawan and Jingling Xue 摘要 Servlet技术是在建立可扩展性Web应用中被应用最广泛的技术。在运用JAVA技术开发Web应用中有四种模型,分别是:Model 1、Model 2、Struts和JavaServer Faces JSF。Model 1使用一连串的JSP页面,Model 2采用了模型,视图,控制器MVC模式。Struts是一个采用了Model 2设计模型的框架,JSF是一种支持ready-to-use组件来进行快速Web应用开发的新技术。Model 1对于中等和大型的应用来说很难维护,所以不推荐使用。本文通过利用Model 2、Struts和JSF这三种模型分别构建三个不同版本的在线商店应用程序来比较和评价这三种模型在应用程序开发和性能上的差异。 1.绪论 当今Web应用是一种展现动态内容的最普遍的方式。构建Web应用有许多种方法,其中最流行的是Servlet技术。这种技术的流行是因为它比CGI、PHP等其他技术更具优越性。然而Servlet对于开发来说还是麻烦的,因为它在传送HTML 标签时需要程序员将他们组合成为一个字符串对象,再将这个对象传给浏览器。同样的,对于输出的一个很小的改动也要求Servlet被重新编译。基于这个原因SUN 公司发明了JavaServer Pages JSP技术。JSP允许HTML标签和Java代码混合在

JAVA思想外文翻译毕业设计

文献来源:Bruce Eckel.Thinking in Java [J]. Pearson Higher Isia Education,2006-2-20. Java编程思想 (Java和因特网) 既然Java不过另一种类型的程序设计语言,大家可能会奇怪它为什么值得如此重视,为什么还有这么多的人认为它是计算机程序设计的一个里程碑呢?如果您来自一个传统的程序设计背景,那么答案在刚开始的时候并不是很明显。Java除了可解决传统的程序设计问题以外,还能解决World Wide Web(万维网) 上的编程问题。 1、客户端编程 Web最初采用的“服务器-浏览器”方案可提供交互式内容,但这种交互能力完全由服务器提供,为服务器和因特网带来了不小的负担。服务器一般为客户浏览器产生静态网页,由后者简单地解释并显示出来。基本HTML语言提供了简单的数据收集机制:文字输入框、复选框、单选钮、列表以及下拉列表等,另外还有一个按钮,只能由程序规定重新设置表单中的数据,以便回传给服务器。用户提交的信息通过所有Web服务器均能支持的“通用网关接口”(CGI)回传到服务器。包含在提交数据中的文字指示CGI该如何操作。最常见的行动是运行位于服务器的一个程序。那个程序一般保存在一个名为“cgi-bin”的目录中(按下Web页内的一个按钮时,请注意一下浏览器顶部的地址窗,经常都能发现“cgi-bin”的字样)。大多数语言都可用来编制这些程序,但其中最常见的是Perl。这是由于Perl是专为文字的处理及解释而设计的,所以能在任何服务器上安装和使用,无论采用的处理器或操作系统是什么。 2、脚本编制语言 插件造成了脚本编制语言的爆炸性增长。通过这种脚本语言,可将用于自己客户端程序的源码直接插入HTML页,而对那种语言进行解释的插件会在HTML 页显示的时候自动激活。脚本语言一般都倾向于尽量简化,易于理解。而且由于它们是从属于HTML页的一些简单正文,所以只需向服务器发出对那个页的一

基于JavaWeb的博客网站的设计与实现外文翻译

外文原文 Database Development Process Based on information engineering information systems planning database is a source of development projects. These new database development projects is usually in order to meet the strategic needs of organizations, such as improving customer support, improve product and inventory management, or a more accurate sales forecast. However, many more database development project is the bottom-up approach emerging, such as information system user needs specific information to complete their work, thus beginning a project request, and as other information systems experts found that organizations need to improve data management and begin new projects. Bottom-up even in the circumstances, to set up an enterprise data model is also necessary to understand the existing database can provide the necessary data, otherwise, the new database, data entities and attributes can be added to the current data resources to the organization. Both the strategic needs or operational information needs of each database development projects normally concentrated in a database. Some projects only concentrated in the database definition, design and implementation of a database, as a follow-up to the basis of the development of information systems. However, in most cases, the database and associated information processing function as a complete information systems development project was part of the development. one. System Development Life Cycle Guide management information system development projects is the traditional process of system development life cycle (SDLC). System development life cycle is an organization of the database designers and programmers information system composed of the Panel of Experts detailed description, development, maintenance and replacement of the entire information system steps. This process is because Waterfall than for every step into the adjacent the next step, that is, the information system is a specification developed by a piece of land, every piece of the output is under an input. However shown

Java的面向对象编程外文资料翻译

毕业设计(论文)外文资料翻译 系:计算机系 专业:计算机科学与技术 姓名: 学号: 外文出处:Ghosh,D..Java Object-oriented (用外文写) programming[J]. IEEE Transactions on Software Engineering,2009, 13(3):42-45. 附件: 1.外文资料翻译译文;2.外文原文。

注:请将该封面与附件装订成册。

附件1:外文资料翻译译文 Java的面向对象编程 ——面向对象编程和它的关键技术—继承和多态性 软件的重用可以节省程序开发时间。它鼓励重复使用已经调试好的高质量的软件,从而减少系统运行后可能出现的问题。这些都是令人振奋的可能性。多态性允许我们用统一的风格编写程序,来处理多种已存在的类和特定的相关类。利用多态性我们可以方便地向系统中添加新的功能。继承和多态对于解决软件的复杂性是一种有效可行的技术。当创建一个新的类时,而不用完整的写出新的实例变量和实例方法,程序员会指定新的类继承已定义的超类的实例变量和实例方法。这个新的类被称为一个子类。每个子类本身将来亦可有新的子类,而其本身将成为父类。一个类的直接父类就是该类所直接继承的类(通过关键字extends继承)。一个间接超类是通过从两级或更多级以上的类继承而来的。例如,从类JApplet(包javax.swing 中)扩展来的类Applet(包java.applet)。一个类单一的从一个父类继承而来。 Java 不支持多重继承(而C++可以),但它支持接口的概念。接口可以使Java实现许多通过多重继承才能实现的优点而没有关联的问题。我们将在本章讨论的接口的详细内容。我们会给出创建和使用接口的一般规律和具体实例。一个子类通常添加自己的实例变量和自己的实例方法,因此子类通常比父类大。一个子类比它的父类更具体并且代表一组更小、更专业的对象。通过单一继承,子类在开始时拥有父类的所有特性。继承性真正的力量在于它可以在定义子类时增加或取代从超类中继承来的特征。每个子类对象也是该类的父类的对象。例如,每一个我们所定义的小程序被认为是类JApplet 的对象。此外,因为Japplet继承了Applet,每一个我们所定义的小程序同时也被认为是一个Applet 的对象。当开发applets时,这些信息是至关重要的,因为一个小程序容器只有当它是一个Applet才可以执行一个程序。虽然子类对象始终可以作为它的父类的一种来看待,父类对象却不被认为是其子类类型的对象。我们将利用这种“子类对象是父类对象”的关系来执行一些强大的操作。例如,绘图程序可以显示一系列图形,如果所有的图形类型都直接或间接地继

java外文翻译

毕业设计外文资料翻译 (译文) 题目名称:Java and the Internet 学院:计算机科学技术 专业年级:计算机科学与技术(师)08 级 学生姓名:aaa 班级学号:a班a号 指导教师:aaa

二○一一年五月十三日 译文题目:Java和因特网 原文题目:Java and the Internet 原文出处:https://www.wendangku.net/doc/7818248229.html,/view.html

Java and the Internet If Java is, in fact, yet another computer programming language, you may question why it is so important and why it is being promoted as a revolutionary step in computer programming. The answer isn’t immediately obvious if you’re coming from a traditional programming perspective. Although Java is very useful for solving traditional stand-alone programming problems, it is also important because it will solve programming problems on the World Wide Web. 1.Client-side programming The Web’s initial server-browser design provided for interactive content, but the interactivity was completely provided by the server. The server produced static pages for the client browser, which would simply interpret and display them. Basic HTML contains simple mechanisms for data gathering: text-entry boxes, check boxes, radio boxes, lists and drop-down lists, as well as a button that can only be programmed to reset the data on the form or “submit” the data on the form back to the server. This submission passes through the Common Gateway Interface (CGI) provided on all Web servers. The text within the submission tells CGI what to do with it. The most common action is to run a program located on the server in a directory that’s typically called “cgi-bin.” (If you watch the address window at the top of your browser when you push a button on a Web page, you can so metimes see “cgi-bin” within all the gobbledygook there.) These programs can be written in most languages. Perl is a common choice because it is designed for text manipulation and is interpreted, so it can be installed on any server regardless of processor or operating system. Many powerful Web sites today are built strictly on CGI, and you can in fact do nearly anything with it. However, Web sites built on CGI programs can rapidly become overly complicated to maintain, and there is also the problem of response time. The response of a CGI program depends on how much data must be sent, as well as the load on both the server and the Internet. (On top of this, starting a CGI program tends to be slow.) The initial designers of the Web did not foresee how rapidly this bandwidth would be exhausted for the kinds of applications people developed. For example, any sort of dynamic graphing is nearly impossible to perform with consistency because a GIF file must be created and moved from the server to the client for eac h version of the graph. And you’ve no doubt had direct experience with something as simple as validating the data on an input form. You press the submit button on a page; the data is shipped back to the server; the server starts a CGI program that discovers an error, formats an HTML page informing you of the error, and then sends the page back to you; you must then back up a page and try again. Not only is this slow, it’s inelegant. The solution is client-side programming. Most machines that run Web browsers are powerful engines capable of doing vast work, and with the original static HTML

15000字的Java外文翻译

xxxx大学高新学院毕业设计(论文) 外文翻译 学生姓名: 院(系): 专业班级: 指导教师: 完成日期:

JSP基础学习资料 一、JSP 技术概述 在Sun 正式发布JSP(JavaServer Pages) 之后,这种新的Web 应用开发技术很快引起了人们的关注。JSP 为创建高度动态的Web 应用提供了一个独特的开发环境。按照Sun 的说法,JSP 能够适应市场上包括Apache WebServer 、IIS4.0 在内的85% 的服务器产品。即使您对ASP “一往情深”,我们认为,关注JSP 的发展仍旧很有必要。 ㈠JSP 与ASP 的简单比较 JSP 与Microsoft 的ASP 技术非常相似。两者都提供在HTML 代码中混合某种程序代码、由语言引擎解释执行程序代码的能力。在ASP 或JSP 环境下,HTML 代码主要负责描述信息的显示样式,而程序代码则用来描述处理逻辑。普通的HTML 页面只依赖于Web 服务器,而ASP 和JSP 页面需要附加的语言引擎分析和执行程序代码。程序代码的执行结果被重新嵌入到HTML 代码中,然后一起发送给浏览器。ASP 和JSP 都是面向Web 服务器的技术,客户端浏览器不需要任何附加的软件支持。 ASP 的编程语言是VBScript 之类的脚本语言,JSP 使用的是Java ,这是两者最明显的区别。此外,ASP 与JSP 还有一个更为本质的区别:两种语言引擎用完全不同的方式处理页面中嵌入的程序代码。在ASP 下,VBScript 代码被ASP 引擎解释执行;在JSP 下,代码被编译成Servlet 并由Java 虚拟机执行,这种编译操作仅在对JSP 页面的第一次请求时发生。 ㈡运行环境 Sun 公司的JSP 主页在https://www.wendangku.net/doc/7818248229.html,/products/jsp/index.html ,从这里还可以下载JSP 规范,这些规范定义了供应商在创建JSP 引擎时所必须遵从的一些规则。 执行JSP 代码需要在服务器上安装JSP 引擎。此处我们使用的是Sun 的JavaServer Web Development Kit (JSWDK )。为便于学习,这个软件包提供了大量可供修改的示例。安装JSWDK 之后,只需执行startserver 命令即可启动服务器。在默认配置下服务器在端口8080 监听,使用http://localhost:8080 即可打开缺省页面。 在运行JSP 示例页面之前,请注意一下安装JSWDK 的目录,特别是“ work ”子目录下的内容。执行示例页面时,可以在这里看到JSP 页面如何被转换成Java 源文件,然后又被编译成class 文件(即Servlet )。JSWDK 软件包中的示例页

java外文翻译资料

*** 学院 毕业设计(论文)外文资料翻译 系(院):计算机工程学院 专业:计算机科学与技术(软件技术)姓名:*** 学号:*** 外文出处:The Programmer (用外文写) 附件: 1.外文资料翻译译文;2.外文原文。

注:请将该封面与附件装订成册。

附件1:外文资料翻译译文 JSP技术概述 JSP的优点 JSP页面最终会转换成servler。因而,从根本上,JSP页面能够执行的任何任务都可以用servler来完成。然而,这种底层的等同性并不意味着servler和JSP页面对于所有的情况都等同适用。问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。毕竟,在特定平台上能够用Java编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要。 和单独使用servler相比,JSP提供下述好处: (1)JSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML:没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。 (2)能够使用标准的网站开发工具。即使对那些对JSP一无所知的HTML 工具,我们也可以使用,因为它们会忽略JSP标签(JSP tags)。 (3)可以对开发团队进行划分。Java程序员可以致力于动态代码。Web 开发人员可以将经理集中在表示层(presentation layer)上。对于大型的项目,这种划分极为重要。依据开发团队的大小,及项目的复杂程度,可以对静态HTML和动态内容进行弱分离(weaker separation)和强分离(stronger separation)。 在此,这个讨论并不是让您停止使用servlets,只使用JSP。几乎所有的项目都会同时用到这两种技术。针对项目中的某些请求,您可能会在MVC构架下组合使用这两项技术。我们总是希望用适当的工具完成相对应的工作,仅仅是servlet并不能填满您的工具箱。 JSP相对于竞争技术的优势

(完整版)Java外文翻译1毕业设计

以下文档格式全部为word格式,下载后您可以任意修改编辑。 毕业设计(论文)外文文献翻 译 译文: Java IO 系统[1] 对编程语言的设计者来说,创建一套好的输入输出(IO)系统,是一项难度极高的任务。 这一类可以从解决方案的数量之多上看出端倪。这个问题就难在它要面对的可能性太多了。不仅是因为有那么多的IO的源和目的(文件,控制台,网络连接等等),而且还有很多方法(顺序的,随机的,缓存的,二进制的,字符方式的,行的,字的等等)。 Java类库的设计者们用“创建很多类”的办法来解决这个问题。坦率地说,Java IO系统的类实在太多了,以至于初看起来会把人吓着(但是,具有讽刺意味的是,这种设计实际上是限制了类的爆炸性增长)。此外,Java在1.0版之后又对其IO类库进行了重大的修改,原先是面向byte的,现在又补充了面向Unicode字符的类库。为了提高性能,完善功能,JDK1.4又加了一个nio(意思是“new IO”。这个名字会用上很多年)。这么以来,如果你想对Java 的IO类库有个全面了解,并且做到运用自如,你就得先

学习大量的类。此外,了解IO类库的演化历史也是相当重要的。可能你的第一反应是“别拿什么历史来烦我了,告诉我怎么用就可以了!”但问题是,如果你对这段一无所知,很快就会被一些有用或是没用的类给搞糊涂了。 本文会介绍Java 标准类库中的各种IO类,及其使用方法。 File 类 在介绍直接从流里读写数据的类之前,我们先介绍一下处理文件和目录的类。 你会认为这是一个关于文件的类,但它不是。你可以用它来表示某个文件的名字,也可以用它来表示目录里一组文件的名字。如果它表示的是一组文件,那么你还可以用list( )方法来进行查询,让它会返回String 数组。由于元素数量是固定的,因此数组会比容器更好一些。如果你想要获取另一个目录的清单,再建一个File对象就是了。 目录列表器 假设你想看看这个目录。有两个办法。一是不带参数调用list( )。它返回的是File对象所含内容的完整清单。但是,如果你要的是一个"限制性列表(restricted list)"的话——比方说,你想看看所有扩展名为.java的文件——那么你就得使用"目录过滤器"了。这是一个专门负责挑选显示File对象的内容的类。 FilenameFilter接口的声明: public interface FilenameFilter { boolean accept(File dir, String name); } accept( )方法需要两个参数,一个是File对象,表示这个文件是在

(完整版)毕设外文翻译-详细解析Java中抽象类和接口的区别

Parsing Java Abstraction of the Difference Between Classes and Interfaces In Java language, abstract scale-up and with support class abstraction definition of two mechanisms. Because of these two kinds of mechanism of existence, just gives Java powerful object-oriented skills. Abstract scale-up and with between classes abstraction definition for support has great similarities, even interchangeable, so many developers into line non-abstract class definition for abstract scale-up and it is becoming more casual with choice. In fact, both between still has the very big difference, for their choice even reflected in problem domain essence of understanding, to design the intentions of the understanding correctly and reasonable. This paper will for the difference analysis, trying to give a developer with a choice between them are based. Understand class abstraction Abstract class and interface in Java language is used for abstract classes (in this article non-abstract class not from abstract scale-up translation, it represents an abstract body, and abstract scale-up for Java language used to define class abstraction in one way, please readers distinguish) defined, then what are the abstract classes, use abstract classes for us any good? In object-oriented concept, we know all objects is through class to describe, but in turn not such. Not all classes are used to describe object, if a class does not contain enough information to portray a concrete object, this class is abstract classes. Abstract classes are often used to characterization of problem field in our analysis, design that the abstract concepts, is to the series will look different, but essentially the same exact conception of abstraction. For example: if we carry out a graphical editing software development, will find problem domain exists round, triangle so some specific concept, they are different, but they all belong to shape such a concept, shape this concept in problem domain is not exist, it is an abstract concept. Precisely because the abstract concepts in problem field no corresponding specific concept, so to characterization abstract concepts non-abstract class cannot be instantiated. In an object-oriented field, mainly used for class abstraction types hidden. We can

java介绍外文翻译

外文原文 Introduction to Java autor:Martin Ngobye. source:Computing Static Slice for Java Programs Java is designed to meet the challenges of application development in the context of heterogeneous, network-wide distributed environments. Paramount among these challenges is secure delivery of applications that consume the minimum of system resources, can run on any hardware and software platform, and can be extended dynamically. Java originated as part of a research project to develop advanced software for a wide variety of network devices and embedded systems. The goal was to develop a small, reliable, portable, distributed, real-time operating platform. When the project started, C++ was the language of choice. But over time the difficulties encountered with C++ grew to the point where the problems could best be addressed by creating an entirely new language platform. Design and architecture decisions drew from a variety of languages such as Eiffel, SmallTalk, Objective C, and Cedar/Mesa. The result is a language platform that has proven ideal for developing secure, distributed, network based end-user applications in environments ranging from network-embedded devices to the World-Wide Web and the desktop. The design requirements of Java are driven by the nature of the computing environments in which software must be deployed. The massive growth of the Internet and the World-Wide Web leads us to a completely new way of looking at development and distribution of software. To live in the world of electronic commerce and distribution, Java must enable the development of secure, high performance, and highly robust applications on multiple platforms in heterogeneous, distributed networks. Operating on multiple platforms in heterogeneous networks invalidates the traditional schemes of binary distribution, release, upgrade, patch, and so on. To survive in this jungle, Java must be architecture neutral, portable, and dynamically adaptable. The Java system that emerged to meet these needs is simple, so it can be easily programmed by most developers; familiar, so that current developers can easily learn Java; object oriented, to take advantage of modern software development methodologies and to fit into distributed client-server applications;

相关文档