15000字的Java外文翻译

15000字的Java外文翻译
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.360docs.net/doc/3111830302.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 软件包中的示例页

面分为两类,它们或者是JSP 文件,或者是包含一个表单的HTML 文件,这些表单均由JSP 代码处理。与ASP 一样,JSP 中的Java 代码均在服务器端执行。因此,在浏览器中使用“查看源文件”菜单是无法看到JSP 源代码的,只能看到结果HTML 代码。所有示例的源代码均通过一个单独的“ examples ”页面提供。

㈢JSP 页面示例

下面我们分析一个简单的JSP 页面。您可以在JSWDK 的examples 目录下创建另外一个目录存放此文件,文件名字可以任意,但扩展名必须为.jsp 。从下面的代码清单中可以看到,JSP 页面除了比普通HTML 页面多一些Java 代码外,两者具有基本相同的结构。Java 代码是通过< % 和%> 符号加入到HTML 代码中间的,它的主要功能是生成并显示一个从0 到9 的字符串。在这个字符串的前面和后面都是一些通过HTML 代码输出的文本。

< HTML>

< HEAD>< TITLE>JSP 页面< /TITLE>< /HEAD>

< BODY>

< %@ page language="java" %>

< %! String str="0"; %>

< % for (int i=1; i < 10; i++) {

str = str + i;

} %>

JSP 输出之前。

< P>

< %= str %>

< P>

JSP 输出之后。

< /BODY>

< /HTML>

这个JSP 页面可以分成几个部分来分析。

首先是JSP 指令。它描述的是页面的基本信息,如所使用的语言、是否维持会话状态、是否使用缓冲等。JSP 指令由< %@ 开始,%> 结束。在本例中,指令“ < %@ page language="java" %> ”只简单地定义了本例使用的是Java 语言(当前,在JSP 规范中Java 是唯一被支持的语言)。

接下来的是JSP 声明。JSP 声明可以看成是定义类这一层次的变量和方法的地方。JSP 声明由< %! 开始,%> 结束。如本例中的“ < %! String str="0"; %> ”定义了一个字符串变量。在每一项声明的后面都必须有一个分号,就象在普通Java 类中声明成员变量一样。

位于< % 和%> 之间的代码块是描述JSP 页面处理逻辑的Java 代码,如本

例中的for 循环所示。

最后,位于< %= 和%> 之间的代码称为JSP 表达式,如本例中的“ < %= str %> ”所示。JSP 表达式提供了一种将JSP 生成的数值嵌入HTML 页面的简单方法。

二、会话状态管理

会话状态维持是Web 应用开发者必须面对的问题。有多种方法可以用来解决这个问题,如使用Cookies 、隐藏的表单输入域,或直接将状态信息附加到URL 中。Java Servlet 提供了一个在多个请求之间持续有效的会话对象,该对象允许用户存储和提取会话状态信息。JSP 也同样支持Servlet 中的这个概念。

在Sun 的JSP 指南中可以看到许多有关隐含对象的说明(隐含的含义是,这些对象可以直接引用,不需要显式地声明,也不需要专门的代码创建其实例)。例如request 对象,它是HttpServletRequest 的一个子类。该对象包含了所有有关当前浏览器请求的信息,包括Cookies ,HTML 表单变量等等。session 对象也是这样一个隐含对象。这个对象在第一个JSP 页面被装载时自动创建,并被关联到request 对象上。与ASP 中的会话对象相似,JSP 中的session 对象对于那些希望通过多个页面完成一个事务的应用是非常有用的。

为说明session 对象的具体应用,接下来我们用三个页面模拟一个多页面的Web 应用。第一个页面(q1.html )仅包含一个要求输入用户名字的HTML 表单,代码如下:

< HTML>

< BODY>

< FORM METHOD=POST ACTION="q2.jsp">

请输入您的姓名:

< INPUT TYPE=TEXT NAME="thename">

< INPUT TYPE=SUBMIT V ALUE="SUBMIT">

< /FORM>

< /BODY>

< /HTML>

第二个页面是一个JSP 页面(q2.jsp ),它通过request 对象提取q1.html 表单中的thename 值,将它存储为name 变量,然后将这个name 值保存到session 对象中。session 对象是一个名字/ 值对的集合,在这里,名字/ 值对中的名字为“ thename ”,值即为name 变量的值。由于session 对象在会话期间是一直有效的,因此这里保存的变量对后继的页面也有效。q2.jsp 的另外一个任务是询问第

二个问题。下面是它的代码:

< HTML>

< BODY>

< %@ page language="java" %>

< %! String name=""; %>

< %

name = request.getParameter("thename");

session.putValue("thename", name);

%>

您的姓名是:< %= name %>

< p>

< FORM METHOD=POST ACTION="q3.jsp">

您喜欢吃什么?

< INPUT TYPE=TEXT NAME="food">

< P>

< INPUT TYPE=SUBMIT V ALUE="SUBMIT">

< /FORM>

< /BODY>

< /HTML>

第三个页面也是一个JSP 页面(q3.jsp ),主要任务是显示问答结果。它从session 对象提取thename 的值并显示它,以此证明虽然该值在第一个页面输入,但通过session 对象得以保留。q3.jsp 的另外一个任务是提取在第二个页面中的用户输入并显示它:

< HTML>

< BODY>

< %@ page language="java" %>

< %! String food=""; %>

< %

food = request.getParameter("food");

String name = (String) session.getValue("thename");

%>

您的姓名是:< %= name %>

< P>

您喜欢吃:< %= food %>

< /BODY>

< /HTML>

三、引用JavaBean 组件

JavaBean 是一种基于Java 的软件组件。JSP 对于在Web 应用中集成JavaBean 组件提供了完善的支持。这种支持不仅能缩短开发时间(可以直接利用经测试和可信任的已有组件,避免了重复开发),也为JSP 应用带来了更多的可伸缩性。JavaBean 组件可以用来执行复杂的计算任务,或负责与数据库的交互以及数据提取等。如果我们有三个JavaBean ,它们分别具有显示新闻、股票价格、天气情况的功能,则创建包含所有这三种功能的Web 页面只需要实例化这三个Bean ,使用HTML 表格将它们依次定位就可以了。

为说明在JSP 环境下JavaBean 的应用,我们创建了一个名为TaxRate 的Bean 。它有两个属性,即Product (产品)和Rate (税率)。两个set 方法分别用来设置这两个属性,两个get 方法则用于提取这两个属性。在实际应用中,这种Bean 一般应当从数据库提取税率值,此处我们简化了这个过程,允许任意设定税率。下面是这个Bean 的代码清单:

package tax;

public class TaxRate {

String Product;

double Rate;

public TaxRate() {

this.Product = "A001";

this.Rate = 5;

}

public void setProduct (String ProductName) {

this.Product = ProductName;

}

public String getProduct() {

return (this.Product);

}

public void setRate (double rateValue) {

this.Rate = rateValue;

}

public double getRate () {

return (this.Rate);

}

}

在JSP 页面中应用上述Bean 要用到< jsp:useBean> 标记。依赖于具体使用的JSP 引擎的不同,在何处配置以及如何配置Bean 的方法也可能略有不同。本文将这个Bean 的.class 文件放在c:jswdk-1.0examplesWEB-INFjsp eans ax 目录下,这里的tax 是一个专门存放该Bean 的目录。下面是一个应用上述Bean 的示例页面:

< HTML>

< BODY>

< %@ page language="java" %>

< jsp:useBean id="taxbean" scope="application" class="tax.TaxRate" />

< % taxbean.setProduct("A002");

taxbean.setRate(17);

%>

使用方法 1 :< p>

产品: < %= taxbean.getProduct() %> < br>

税率: < %= taxbean.getRate() %>

< p>

< % taxbean.setProduct("A003");

taxbean.setRate(3);

%>

< b> 使用方法 2 :< /b> < p>

产品: < jsp:getProperty name="taxbean" property="Product" />

< br>

税率: < jsp:getProperty name="taxbean" property="Rate" />

< /BODY>

< /HTML>

在< jsp:useBean> 标记内定义了几个属性,其中id 是整个JSP 页面内该Bean 的标识,scope 属性定义了该Bean 的生存时间,class 属性说明了该Bean 的类文件(从包名开始)。

这个JSP 页面不仅使用了Bean 的set 和get 方法设置和提取属性值,还用到了提取Bean 属性值的第二种方法,即使用< jsp:getProperty> 标记。< jsp:getProperty> 中的name 属性即为< jsp:useBean> 中定义的Bean 的id ,它的property 属性指定的是目标属性的名字。

事实证明,Java Servlet 是一种开发Web 应用的理想构架。JSP 以Servlet 技术为基础,又在许多方面作了改进。JSP 页面看起来象普通HTML 页面,但它允许嵌入执行代码,在这一点上,它和ASP 技术非常相似。利用跨平台运行的JavaBean 组件,JSP 为分离处理逻辑与显示样式提供了卓越的解决方案。JSP 必

将成为ASP 技术的有力竞争者。

The JSP basic learning material

1. JSP technology overview

In from the official launch JSP (JavaServer Web), then the new Web application development skills quickly to cause the attention of people. The JSP for creating highly dynamic Web application provides a unique development environment. According to the statement from can adapt to the market, the JSP WebServer, including I can with Apache IIS4.0, 85% of server products. Even if you the ASP "madly", we believe, paying attention to the development of JSP are still very be necessary.

(1)JSP simple compared with ASP

The JSP and Microsoft of ASP technology are very similar. Both offer in HTML code mixed some code, by the language engine interpretive execution code's ability. In ASP and JSP environment, HTML code is mainly responsible for describe information display, and program code is used to describe handling logic. Normal HTML page only depends on the Web server and the ASP and JSP page need additional language engine analysis and implementation program code. The program code to be executing embedded into HTML code, then the message to all browsers. ASP and JSP are facing the Web server technology, the client browser does not need any additional software support.

ASP programming language is VBScript such scripting language, JSP use is Java, this is both one of the most significant differences. In addition, ASP and JSP more essential difference: two languages in a totally different way engine handling page embedded program code. In the ASP, VBScript code is ASP engines interpret execution; In the JSP, code has been compiled into Java virtual machine by Servlet and execution, the compiler operation is only on the JSP page first request happen.

(2)Dimension of running environment

From the JSP page in https://www.360docs.net/doc/3111830302.html,/products/jsp/index.html, from here can also download the JSP specification, these standard defines the supplier in creating JSP engine when must comply to some rules.

Execute JSP code needed on the server installation JSP engine. Here we use is from the Development Kit (JavaServer Web JSWDK). To facilitate learning, this package offers a lot for modification examples. JSWDK after installation, just need to perform startserver command can server. The default configuration server in the port 8080

surveillance, use http://localhost:8080 can open default page.

In running the JSP sample page before installation, please pay attention to the JSWDK directory, especially "schools" subdirectories of content. Execute the sample pages, here can see how the JSP page are converted into Java source file, then compiled into scale-up file (i.e. Servlet). JSWDK packages examples in the page is divided into two categories, they or JSP files, or is included in a form of HTML files, these forms all by JSP code processing. And as the Java, JSP ASP code are executed on the server. Therefore, in the browser use "the view source" menu is unable to see the JSP code, can see the results HTML code. All the source code examples are by a single "provide examples" page.

Eclipse is an open source, based on a Java extensible development platform. Eclipse it just a framework and a set of service, used to construct the Development environment through plug-ins components, the key is Eclipse comes in a standard plugin sets, including Java Development Tools (Java Development Tools, JDT). The Eclipse is developed by IBM alternative commercial software for the next generation of Java Visual age-related IDE development environment, November 2001 contribution to the open source community, now by a non-profit software vendors alliance Eclipse Foundation (Eclipse Foundation) management.

(3)JSP page examples

Below we analyze a simple JSP page. You can JSWDK examples in the directory create another directory store this file, the file name can be arbitrary, but extensions must serve. JSP. From the code below the list can see, except the JSP page than ordinary HTML page more Java code outside, both has the same basic structure. Java code is through < % and % > symbols to join in the middle of the HTML code, its main function is to generate and display a from 0 to 9 string. In the string in the front and rear of the HTML code that some are through the text output.

< HTML>

< HEAD>< TITLE>JSP PAGE < /TITLE>< /HEAD>

< BODY>

< %@ page language="java" %>

< %! String str="0"; %>

< % for (int i=1; i < 10; i++) {

str = str + i;

} %>

JSP Before out。

< P>

< %= str %>

< P>

JSP After out。

< /BODY>

< /HTML>

The JSP page can be divided into several parts for analysis.

First is the JSP instructions. It describes the basic information of the page, such as the use of language, whether to maintain conversation status, whether to use cushion etc. The JSP instructions by < % @ beginning, % > over. In this example, directive "< % @ brief language =" Java "% >" simply defines this example is using Java language (at present, in the JSP specification in Java is the only support language).

Next came the JSP statement. The JSP statement may be regarded as the definition of this level of variables and method of place. The JSP statement by < %! Start, % > over. If the cases of "< %! String STR =" 0 "; % > "defines a String variable. In every statement behind must have a semicolon, just like in ordinary Java class declaration in the same member variables.

Located in < % and % > between the code block is to describe the JSP page handling logic of Java code, such as the example shown the seas cycle.

Finally, located in < % = and % > between code is called the JSP expression, such as the example of "< % = STR % >" below. The JSP expression provides a will JSP generated numerical embedded HTML pages of simple method.

2. The session state management

The session state maintain is the Web application developers must face the problem. There are various ways can be used to solve this problem, if use Cookies, hidden form input domain, or directly to the URL in additional status information. Java Servlet provides a continuous effectively in multiple requests the conversation between objects, the object allows users to store and retrieve the session state information. The JSP also support Servlet of this concept.

In the JSP from guidelines can see many relevant implied object instructions (implicit meaning is that these objects can directly referenced, do not need explicit statement, also do not need special code to create actually cases). For example that object, it is the HttpServletRequest a derived class. The object contains all the related current browser requests information, including Cookies, HTML form variables, etc. Session object is also such a hidden objects. This object in the first JSP page is loaded, and automatically created by related to that objects. The conversation with ASP object of similar, JSP session object for those who hope that through multiple pages to complete a

affairs application is very useful.

To illustrate the session object concrete application, next we use three pages more than a page of simulation Web application. The first page (q1. HTML) contain only a requirement to enter your user name HTML forms, the HTML code is as follows: < HTML>

< BODY>

< FORM METHOD=POST ACTION="q2.jsp">

Please write your name:

< INPUT TYPE=TEXT NAME="thename">

< INPUT TYPE=SUBMIT V ALUE="SUBMIT">

< /FORM>

< /BODY>

< /HTML>

The second page is a JSP page (q2. JSP), it through that object extraction in q1. HTML form thename value, it will be stored for name variable, then will the name value saved to the session objects. Session object is a name/value pairs set, here, name/value pairs of the name is "thename", namely for name values of the value of the variable. Due in session during the session object is effective until, so here preserved variables on subsequent page as well. Q2. JSP another task is to ask the second question. Below is its code:

< HTML>

< BODY>

< %@ page language="java" %>

< %! String name=""; %>

< %

name = request.getParameter("thename");

session.putValue("thename", name);

%>

What is your name:< %= name %>

< p>

< FORM METHOD=POST ACTION="q3.jsp">

What do you want to eat?

< INPUT TYPE=TEXT NAME="food">

< P>

< INPUT TYPE=SUBMIT V ALUE="SUBMIT">

< /FORM>

< /BODY>

< /HTML>

The third page is a JSP page (percentile. JSP), main task is to show the q&a results. It from the value of the thename session object extraction and display it, prove the value in the first though page input, but through session object is maintained. Percentile. JSP

another task is to extract the user input at the second page and displays it: < HTML>

< BODY>

< %@ page language="java" %>

< %! String food=""; %>

< %

food = request.getParameter("food");

String name = (String) session.getValue("thename");

%>

Your name is:< %= name %>

< P>

Your favorite food is:< %= food %>

< /BODY>

< /HTML>

3. Citing JavaBean components

Based on a Java JavaBean is a kind of software component. In Web applications for the JSP integrated JavaBean component provides the perfect support. This support can not only shorten time (can use directly by test and trustworthy of existing components, to avoid the repeated development), but also for the JSP application has brought more scalability. JavaBean components can be used to execute complex computing tasks, or responsible and database of interaction and data extraction, etc. If we have three JavaBean, they respectively display news, stock price, weather conditions function, they create contain all these three functions of Web page only need to instantiate the three Bean, using HTML forms will be they in turn positioning is ok.

To illustrate the JSP JavaBean application environment, we created a name of TaxRate Bean. It has two attributes that our Product (products) and Rate (tax). Two set separately used to set the two properties, and two the get method is used to extract the two attributes. In practical applications, this kind of Bean shall generally be from a database abstraction tax rate, here we simplify the value of this process, allows any setting rate. Below is the Bean code list:

package tax;

public class TaxRate {

String Product;

double Rate;

public TaxRate() {

this.Product = "A001";

this.Rate = 5;

}

public void setProduct (String ProductName) {

this.Product = ProductName;

}

public String getProduct() {

return (this.Product);

}

public void setRate (double rateValue) {

this.Rate = rateValue;

}

public double getRate () {

return (this.Rate);

}

}

In applying the above JSP page Bean will use < > markup. UseBean JSP: Depend on specific use JSP engine is different, where configuration, and how to configure Bean approach can be slightly different. This paper will the Bean, scale-up files in c: JSWDK - 1.0 examplesWEB - INFjspeans ax directory, here is a special store the tax Bean directory. Below is an example of applying the above Bean page:

< HTML>

< BODY>

< %@ page language="java" %>

< jsp:useBean id="taxbean" scope="application" class="tax.TaxRate" />

< % taxbean.setProduct("A002");

taxbean.setRate(17);

%>

Method of use 1:< p>

product: < %= taxbean.getProduct() %> < br>

Tax rates:< %= taxbean.getRate() %>

< p>

< % taxbean.setProduct("A003");

taxbean.setRate(3);

%>

< b> Method of use 2 :< /b> < p>

product : < jsp:getProperty name="taxbean" property="Product" />

< br>

Tax rates : < jsp:getProperty name="taxbean" property="Rate" />

< /BODY>

< /HTML>

In < jsp:useBean> markup within useBean JSP: defines several attribute, including id is whole the JSP page within the scope of the logo, Bean Bean property defines the attributes of the survival time, scale-up illustrate the Bean class files (from the package

name start).

This not only the JSP page using Bean of set and the get method Settings and extraction attribute value, also used to extract Bean attribute value the second method, which USES < > markup. GetProperty JSP: The getProperty > < JSP: name attribute namely for < JSP: useBean > defined in the Bean id, its property attribute specified is the target attribute names.

Facts prove that Java Servlet is one kind of development the Web application ideal framework. The JSP with Servlet technology as the foundation, and in many ways improved. The JSP page looks like ordinary HTML pages, but allows embedded code execution, at this point, it and the ASP technology are very similar. Using cross-platform running JavaBean components, JSP for separation treatments logic and display provides excellent solutions. The JSP will become the ASP technology contender.

外文翻译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页的一些简单正文,所以只需向服务器发出对那个页的一

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.360docs.net/doc/3111830302.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.360docs.net/doc/3111830302.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;

java毕业论文外文文献翻译

Advantages of Managed Code Microsoft intermediate language shares with Java byte code the idea that it is a low-level language witha simple syntax , which can be very quickly translated intonative machine code. Having this well-defined universal syntax for code has significant advantages. Platform independence First, it means that the same file containing byte code instructions can be placed on any platform; atruntime the final stage of compilation can then be easily accomplished so that the code will run on thatparticular platform. In other words, by compiling to IL we obtain platform independence for .NET, inmuch the same way as compiling to Java byte code gives Java platform independence. Performance improvement IL is actually a bit more ambitious than Java bytecode. IL is always Just-In-Time compiled (known as JIT), whereas Java byte code was ofteninterpreted. One of the disadvantages of Java was that, on execution, the process of translating from Javabyte code to native executable resulted in a loss of performance. Instead of compiling the entire application in one go (which could lead to a slow start-up time), the JITcompiler simply compiles each portion of code as it is called (just-in-time). When code has been compiled.once, the resultant native executable is stored until the application exits, so that it does not need to berecompiled the next time that portion of code is run. Microsoft argues that this process is more efficientthan compiling the entire application code at the start, because of the likelihood that large portions of anyapplication code will not actually be executed in any given run. Using the JIT compiler, such code willnever be compiled.

相关文档
最新文档