第一篇:毕业设计网上选课系统ASP外文翻译
论文题目姓名学号班级年级专业学院指导教师完成时间
外文翻译
(一)网上选课系统
软件工程
软件学院
2014年 5 月13日
: : : : : : : : :
东华理工大学毕业设计(外文翻译)
英文原文
英文原文
The Active Server Pages(ASP)is a server to carry the script plait writes the environment, using it can create to set up with circulate the development, alternant Web server application procedure.Using the ASP cans combine the page of HTML, script order to create to set up the alternant the page of Web with the module of ActiveX with the mighty and applied procedure in function that according to Web.The applied procedure in ASP develops very easily with modify.1.The working principle of ASP
When the Web site into the ASP feature, will take place the following things:(1)the user browser address bar to enter a URL, the default page of the expansion are.Asp.(2)the browser request to the server.(3)the server engine running ASP procedures.(4)ASP document in accordance with the order from top to bottom starting with the implementation of the script orders, the implementation of HTML page content.(5)pages of information sent to the browser.2.ASP operating environment Asp need to run in under the PWS or IIS.PWS or IIS services in windows98 or windows2000 on the fringe of the CD-ROM, can use the “Add / Remove Programs” in the “Add / Remove windows components” to install.Asp and the general need to access databases or a combination of SQL Server database, made a powerful process.ASP can run the web server software
Windows2000 default installation is IIS5.0(internet information server), and the default installation of windows xp is IIS5.1, windows 2003 default installation of IIS6.0.PWS(personal web server)running windows98 environment in a simple personal Web server.3.ASP and the meaning of ASP(Application Service Provider, application software rental service providers)refers “through the Internet to provide application software rental services industry”, refers to the application software industry as the mainstay, and through one-to-many network Transmission services, such service-based business transactions to be leased by the way, in a more cost-effective manner has the right to use the software, and also because the industry centralized management and greatly reduce the cost of maintaining enterprises.1 东华理工大学毕业设计(外文翻译)
英文原文
Basically, ASP is a “software services, Internet services,” and “outsourcing of information services and network integration” and “access of products, access products,” such as the three major characteristics, can even be seen as ISP(Internet Service Provider)and ITS(Information Technology Service)combination.ASP is the English Application Service Provider, the standard Chinese translation is “application service provider”, is defined as commercial or individual customer management applications to provide solutions for companies or enterprises.ASP Chaozuo recently by the media is very fiery, the IT industry is not facing a pile of technical terms it is very difficult to clarify terminology ASP content, the paper tried to use simple language to the broad masses of readers opened the mysterious veil of ASP, IT Top of the ASP industry areas have some basic knowledge.4.Origin of ASP
The research to ASP mode and ASP enterprise's origin can proceed with two respects , one to in terms of business and technology , is it carry on research to come from ASP developing history that business commit;Another one is studies the origins of ASP enterprises and evolution course at present in terms of organization's development.Whether stand up synthetically above-mentioned developing stage, to put it briefly, present ASP history and development path of provider can simple to describe as: The first, developed from the past ISP, rounded the infrastructure and communication function, cooperate with software manufacturer, increase the business scope, develop into the present IDC(the data centre of Internet);
The second,the past ISV(independent software provider)and VAR(the trader that resells value-added service), at Internet age , changed the marketing way in the past , would rely mainly on sale of the software product to change direction to rely mainly on the fact that right to use is leased in the past, bale from physics carrier encapsulation way change direction and long-range operation way main fact now, through the cooperation with network operator , realize the transition to ASP;
The third,IT service departments and traditional advisory companies of traditional large-scale organization, at the foundation known deeply in Internet , depend on long-term experience, is it carry on systematic design and implementation of scheme for other customer to begin, through establish in with trader who operates network and alliance relation between the application software manufacturer, realize the ASP provider that appears in the capacity of system integration trader.5.The developing history and classification of ASP
Seen from the present, ASP is as emerging and proposing formally it is only a thing from the end of 1998 to the beginning of 1999 of a kind of mode.And until from the end of 1999 to the beginning of 2000 to a great extent, ASP field relevant东华理工大学毕业设计(外文翻译)
英文原文
outstanding behaviors at the capital market of Company just cause people's extensive concern.In fact speaking from the intension and essence of ASP mode, it is not the brand-new things, but the mode that had once had, has been given the new vitality at Internet age.During this festival, we will review the course that ASP produce development and develop, in order to help the essence of better deep understanding ASP.At the end, we will concentrate on introducing the situation which enterprises divide from different standards in ASP field at present.The HTML plait writes the personnel if you are a simple method that a HTML plait writes the personnel, you will discover the script of ASP providing to create to have diplomatic relation with each other page.If you once want that collect the data from the form of HTML, or use the name personalization HTML document of the customer, or according to the different characteristic in different usage of the browser, you will discover ASP providing an outstanding solution.Before, to think that collect the data from the form of HTML, have to study a plait distance language to create to set up a CGI application procedure.Now, you only some simple instruction into arrive in your HTML document, can collect from the form the data combine proceeding analysis.You need not study the complete plait distance language again or edit and translate the procedure to create to have diplomatic relation alone with each other page.Along with control to use the ASP continuously with the phonetic technique in script, you can create to set up the more complicated script.For the ASP, you can then conveniently usage ActiveX module to carry out the complicated mission, link the database for example with saving with inspectional information.If you have controlled a script language, such as VBScript, JavaScript or PERL, and you have understood the method that use the ASP.As long as installed to match the standard cowgirl in the script of ActiveX script engine, can use in the page of ASP an any a script language.Does the ASP take the Microsoft? Visual Basic? Scripting Edition(VBScript)with Microsoft? Script? Of script engine, like this you can start the editor script immediately.PERL, REXX with Python ActiveX script engine can from the third square develops the personnel acquires.The Web develops the personnel if you have controlled a plait distance language, such as Visual Basic, you will discover the ASP creates a very vivid method that set up the Web application procedure quickly.Pass to face to increase in the HTML the script order any, you can create the HTML that set up the applied procedure connects.Pass to create to set up own the module of ActiveX, can will apply the business in the procedure logic seal to 东华理工大学毕业设计(外文翻译)
英文原文
pack and can adjust from the script, other module or from the other procedure the mold piece that use.The usage ASP proceeds the calculating Web can convert into the visible benefits, it can make the supplier of Web provide the alternant business application but not only is to announce the contents.For example, the travel agency can compare the announcement aviation schedule makes out more;Using the script of ASP can let the customer inspect the current service, comparison expenses and prepare to book seats.Include too can lower in the Windows NT Option Microsoft in the pack Transaction Server(MTS)on the server complexity of constructing the procedure with expenses.The MTS can resolve to develop those confidentialities strong, can ratings of and the dependable Web applies the complexity problem of the procedure.6.Active Server Pages model The browser requests from the server of Web.Hour of asp document, the script of ASP starts circulating.Then the server of Web adjusts to use the ASP, the ASP reads completely the document of the claim, carry out all scripts order any, combining to deliver the page of Web to browser.Because script is on the server but is not at the customer to carry the movement, deliver the page of Web on the browser is on the Web server born.Combining to deliver the standard HTML to browser.Because only the result that there is script returns the browser, so the server carries the not easy replication in script.The customer cans not see to create to set up them at script order that the page that view.We introduce the Basic form of the database language known as SQL, a language that allows us to query and manipulate data on computerized relational database systems.SQL has been the lingua franca for RDBMS since the early 1980s, and it is of fundamental importance for many of the concepts presented in this text.The SQL language is currently in transition from the relational form(the ANSI SQL – 92 standard)to a newer object-relational form(ANSI SQL-99, which was released in 1999).SQL-99 should be thought of as extending SQL-92, not changing any of the earlier valid language.Usually, the basic SQL we define matches most closely the ANSI SQL standards basic subsets, called Entry SQL-92 and core SQL-99 that are commonly implemented;our touchstone in defining basic SQL is to provide a syntax that is fully available on most of the major RDBMS products.东华理工大学毕业设计(外文翻译)
英文原文
We begin with an overview of SQL capabilities, and then we explain something about the multiple SQL standards and dialects and how we will deal with these in our presentation.We will learn how to pose comparable queries in SQL, using a form known as the Select statement.As we will see, the SQL select statement offers more flexibility in a number of ways than relational algebra for posing queries.However, there is no fundamental improvement in power, nothing that could not be achieved in relational algebra , given a few well-considered extensions.For this reason, experience with relational algebra gives us a good idea of what can be accomplished in SQL.At the same time, SQL and relational algebra have quite different conceptual models in a number of respects, and the insight drawn from familiarity with the relational algebra approach may enhance your understanding of SQL capabilities.The most important new feature you will encounter with SQL is the ability to pose queries interactively in a computerized environment.The SQL select statement is more complicated and difficult to master than the relatively simple relational algebra, but you should never feel list or uncertain as long as you have access to computer facilities where a few experiments can clear up uncertainties about SQL use.The interactive SQL environment discussed in the current chapter allows you to type a query on a monitor screen and get an immediate answer.Such interactive queries are sometimes called ad box queries.This term refers to the fact that an SQL select statement is meant to be composed all at once in a few type written lines and not be dependent on any prior interaction in a user session.The feature of not being dependent on prior interaction is also down as non-procedurality.SQL differs in this way even from relational algebra, where a prior alias statement might be needed in order to represent a product of a table with itself.The difference between SQL and procedural languages such as java or c is profound: you do not need to write a program to try out an SQL query, you just have to type the relatively short, self-contained text of the query and submit it.Of course, an SQL query can be rather complex.A limited part of this full form, know as a sub-query, is defined recursively, and the full select statement form has one added clause.You should not feel intimidated by the complexity of the select statement, however.The fact that a select statement is non-procedural means that it has a lot in common with a menu driven application, where a user is expected to fill in some set of choices from a menu and then press the enter key to execute the menu 东华理工大学毕业设计(外文翻译)
英文原文
choices all at once.The various clauses of the select statement correspond to menu choices: you will occasionally need all these clauses, but on not expect to use all of them every time you pose a query.Observed reliability depends on the context in which the system s used.As discussed already, the system environment cannot be specified in advance nor can the system designers place restrictions on that environment for operational systems.Different systems in an environment may react to problems in unpredictable ways, thus affecting the reliability of all of these systems.There for, even when the system has been integrated, it may be difficult to make accurate measurements of its reliability.7.Visual Basic Database Access prospects With the recent Web application software and the rapid development of the existing data stored in diverse forms, Visual Basic Database Access Solutions faces such as rapid extraction enterprises located in the internal and external business information with the multiple challenges.To this end Microsoft, a new database access strategy “unified data access”(UniversalDataAccess)strategy.“Unified data access” to provide high-performance access, including relational and non-relational data in a variety of sources, provide independent in the development of language development tools and the simple programming interface, these technologies makes enterprise integration of multiple data sources, better choice of development tools, application software, operating platforms, and will establish a maintenance easy solution possible.东华理工大学毕业设计(外文翻译)
汉语翻译
汉语翻译
Active Server Pages(ASP)是服务器端脚本编写环境,使用它可以创建和运行动态、交互的 Web 服务器应用程序。使用 ASP 可以组合 HTML 页、脚本命令和 ActiveX 组件以创建交互的 Web 页和基于 Web 的功能强大的应用程序。ASP 应用程序很容易开发和修改。1.ASP的工作原理
当在Web站点中融入ASP功能后,将发生以下事情:
(1)用户向浏览器地址栏输入网址,默认页面的扩展名是.asp;
(2)浏览器向服务器发出请求;
(3)服务器引擎开始运行ASP程序;
(4)ASP文件按照从上到下的顺序开始处理,执行脚本命令,执行HTML页面内容;
(5)页面信息发送到浏览器;
2.ASP的运行环境
ASP需要运行在PWS或IIS下。PWS或IIS服务在windows98或windows2000的光盘上附带着,可以通过“添加/删除程序”中的“添加/删除windows组件”来安装。
一般asp需与access数据库或SQL Server数据库结合使用,编出功能强大的程序。能够运行ASP的web服务器软件:
Windows2000默认安装的是IIS5.0(internet information server),而windows XP默认安装的是IIS5.1,windows 2003默认安装的IIS6.0。
PWS(personal web server)运行在windows98环境下的简单个人网页服务器。3.ASP的意义与特性
ASP(Application Service Provider,应用软体租赁服务提供者)是指“透过网路以租赁方式提供应用软体服务的业者”,即业者以应用软体为主体,透过网路一对多地传递服务,这种以服务为主的交易模式促使企业可藉由租赁的方式,以更符合成本效益的方式拥有软体的使用权,并且亦能因为业者集中式的管理而大幅降低企业维护的成本。
基本上,ASP即具有“软体服务化,服务网路化”,“资讯委外服务与网路结合”与“产品通路化,通路产品化”等三大特性,甚至可以被视为是ISP(Internet Service Provider)与ITS(Information Technology Service)的结合。
ASP的英文是Application Service Provider,中文的标准翻译就是“应用服务提供商”,是指为商业或者个人客户提供管理应用解决方案的公司或者企业。最近ASP被媒体炒作的十分火热,不是IT行业的人面对一堆技术名词专业术语很 东华理工大学毕业设计(外文翻译)
汉语翻译
难弄清楚ASP的内容,本文试图用浅显的语言来为广大的读者揭开ASP神秘的面纱,对于IT行业的大热门ASP领域有一些基本的认识。
4.ASP的起源
对于ASP模式和ASP企业起源的研究可以从两个方面入手,一个是从业务和技术的角度,从ASP业务构成的发展历史来进行研究;另一个是从组织机构发展的角度,来研究目前ASP企业的由来和演化过程。
将上述发展阶段综合起来,简单的说,目前的ASP提供商的历史和发展道路可以简单的描述为:
第一类,从过去的ISP发展起来,围绕基础设施和通讯功能,与软件厂商合作,增加业务范围,发展到现在的IDC(互联网数据中心);
第二类,过去的ISV(独立软件提供商)和VAR(增值服务转售商),在互联网时代,改变过去的营销方式,将过去以软件产品的出售为主转向以使用权租赁为主,从物理载体的打包封装方式转向现在在线和远程运行方式为主,通过与网络运营商的合作,实现向ASP的转型;
第三类,传统的大型组织的IT服务部门和传统的咨询公司,在对于互联网的深刻认识的基础上,依靠长期的经验,开始为其他客户进行系统方案的设计和实施,通过建立在与网络运行商和应用软件制造商之间的联盟关系,实现以系统集成商身份出现的ASP提供商。5.ASP的发展历史与分类
从目前来看,ASP作为一种模式的正式诞生和提出只是在1998年底到1999年初之间的事情。而很大程度上直到1999年末到2000年初,ASP领域相关公司在资本市场上的突出表现才引起了人们的广泛关注。实际上从ASP模式的内涵和本质上讲,并不是全新的事物,而是曾经有过的模式,在互联网时代被赋予了新的生命力。在本节中,我们将回顾ASP产生发展演变的过程,以帮助更好的深入理解ASP的本质。在最后,我们将集中介绍目前ASP领域内企业从不同标准进行划分的情况。
HTML 编写人员 如果您是位 HTML 编写人员,您将发现 ASP 脚本提供了创建交互页的简便方法。如果您曾想从 HTML 表格中收集数据,或用顾客的姓名个人化 HTML 文件,或根据浏览器的不同使用不同的特性,您会发现 ASP 提供了一个出色的解决方案。以前,要想从 HTML 表格中收集数据,就不得不学习一门编程语言来创建一个 CGI 应用程序。现在,您只要将一些简单的指令嵌入到您的 HTML 文件中,就可以从表格中收集数据并进行分析。您再不必学习完整的编程语言或者单独编译程序来创建交互页。东华理工大学毕业设计(外文翻译)
汉语翻译
随着不断掌握使用 ASP 和脚本语言的技巧,您可以创建更复杂的脚本。对于 ASP,您可以便捷地使用 ActiveX 组件来执行复杂的任务,比如连接数据库以存储和检索信息。
如果您已经掌握一门脚本语言,如 VBScript、JavaScript 或 PERL,而且您已经了解使用 ASP 的方法。只要安装了符合 ActiveX 脚本标准的相应脚本引擎,就可以在 ASP 页中使用任何一种脚本语言。ASP 带有 Microsoft? Visual Basic? Scripting Edition(VBScript)和 Microsoft? Script? 的脚本引擎,这样您可以立即开始编辑脚本。PERL、REXX 和 Python 的 ActiveX 脚本引擎可以从第三方开发人员处获得。Web 开发人员 如果您已经掌握了一门编程语言,如 Visual Basic,您将发现 ASP 是快速创建 Web 应用程序的一个非常灵活的方法。通过向 HTML 中添加脚本命令,您能够创建应用程序的 HTML 接口。通过创建自己的 ActiveX 组件,可以将应用程序中的商业逻辑封装到能够从脚本、其他组件或从其他程序中调用的模块。
使用 ASP 进行计算的 Web 可转化为有形的利益,它使 Web 供应商能够提供交互的商业应用而不仅仅是发布内容。例如,旅行社能够比公布航空时刻表做得更多;用 ASP 脚本可以让客户察看现有的航班、比较费用并预定座位。
包含在 Windows NT Option pack 中的 Microsoft Transaction Server(MTS)可以降低在服务器上构造程序的复杂性和费用。TS 可以解决开发那些保密性强的、可分级的
以及可靠的 Web 应用程序的复杂性问题。6.Active Server Pages模型
浏览器从 Web 服务器上请求.asp 文件时,然后 Web ASP 脚本开始运行。服务器调用 ASP,执行所有脚本命令,并将 Web 页ASP 全面读取请求的文件,传送给浏览器。
由于脚本在服务器上而不是在客户端运行,传送到浏览器上的 Web 页是在 Web 服务器上生成的。所以不必担心浏览器能否处理脚本:Web 服务器已经完成了所有脚本的处理,并将标准的 HTML 传输到浏览器。由于只有脚本的结果返回到浏览器,所以服务器端脚本不易复制。用户看不到创建他们正在浏览的页的脚本命令。
我们将介绍著名数据库语言的SQL的基本形式。SQL是允许我们查询和操作关于计算机化的关系数据库系统的语言。从80 年代初期,SQL就一直是关系数据库管理系统的语言,而且它是有着重要的意义的在对许多概念中,都在本文 东华理工大学毕业设计(外文翻译)
汉语翻译
里提到。当前,SQL语言是从关系形式(ANSI SQL-92 标准)转向一个新的对象关系形式(ANSI SLQ-99,1999 被发布)。SQL-99 是SQL-92的延伸,它不改变所有早期版本的优秀的语言。通常,我们严格定义的基本SQL与ANSI SQL 标准和基础子集十分类似,分别被认为就是ENTRY SQL-92 和CORE SQL-99。我们也介绍了ENTRY SQL-92、CORE SQL-99之外一些广泛实现的特性。在定义基本的SQL中,我们的试金石是将提供一种支持大多RDBMS 接口的语法。
首先,我们总的研究SQL的特性,然后对SQL的多种形式标准和产品语言以及我们将如何具体地处理这些标准和产品语言进行分析解释。
我们知道了怎样完成关系代数来回应对查询的数据库信息。这将让我们看到,在编写查询语句时SQL中的SELECT在很多方面都比关系代数强大。但是,二者在性能上相比较,SQL在本质上并没有明显的改进。对那些周密的扩展语法来说,没有关系代数所不能实现的。所以,关系代数查询方面的经验就能成为SQL查询的很好的借鉴。同时在许多方面,SQL语句和关系代数概念模型又有着相当大的差异,而可以通过熟悉、理解关系代数增强对SQL的理解。
最重要的SQL特性是它拥有在计算机输出的条件下能够相互地构造查询的能力。SQL的SELECT语句比简单的关系代数更难,但只要能够上机实践,只需几个典型实验就收回你的怀疑。我们所谈论的交互式环境是你在电脑上一输入一个查询语句并且立即执行,就可以看到结果。此情况说明了这样一个事实,一个SQL 的SELECT语句是在打入一些输入行之后立即形成的,并且对一个用户来说该语句与前面的任何交互操作都没有关系。这种不依赖于用户会话互相通信操作的性质也被称作非过程性。在这方面SQL也与关系代数不同,因为在关系代数中为了表示一个表与自身的笛卡儿积,在表前面可能需要定义表别名。SQL与比如JAVA或C之类的语言之间的差别十分巨大的:你不需要为了实现一个SQL查询的功能而编写一个程序,你只需要量输入较短的、独立的查询语句,然后运行就可以了。
当然,SQL查询可能会复杂。为此,我们列出了SELECT语句的完整形式。取出这个形式的一个部分的查询被称为子查询,对它的定义是递归的,完整的SELECT语句形式只有一个子句。无论如何,你不应恐惧复杂的SQL语句。在使用菜单的应SELECT语句的非过程性说明了它与使用菜单的应用十分相似。用中,用户需要从菜单中填写一组数据,然后按下回车来对它们立即执行。但并不是所有SELECT语句的各种子句对于菜单选项有时也会需要所有的子句,的子句在每次查询的时候都用上。东华理工大学毕业设计(外文翻译)
汉语翻译
观察可靠性应考虑系统使用环境。依照已经讨论的内容,系统环境无法预先被描述,系统设计者也不可能对系统工作环境做过多限制。不同的系统对相同环境中的同样问题还可能有无法预料的反应,所有这些都影响系统的可靠性。因此,即使在系统被集成之后,它的可靠性也是难以精确测量的。7.Visual Basic访问数据库的前景:
近来随着Web应用软件的迅速发展和现有数据存储形式的多种多样,Visual Basic访问数据库的解决方案面临诸如快速提取分布于企业内部和外部有用商业信息等的多种挑战。为此Microsoft提出一种新的数据库访问策略,即“统一数据访问”(Universal Data Access)的策略。“统一数据访问”提供了高性能的存取包括关系型和非关系型在内的多种数据源,提供独立于开发工具和开发语言的简单的编程接口,这些技术使得企业集成多种数据源、选择更好的开发工具、应用软件、操作平台、建立容易维护的解决方案成为可能。
第二篇:网上选课系统毕业设计总结
网上选课系统总结
1、前言
随着社会的发展,学生培养计划已不再一成不变,各个学校纷纷推出了面向全体学生的选课服务,这项旨在为大家提供一个更加宽松自由而且更符合学生意愿的服务已成为当代学生过程中不可缺少的一部分。正式计算机技术的迅速发展使得人们从过去复杂的手工劳动中得以解脱,从而使这种服务在现在才可能迅速普及,同时编写一套完整的学生信息显得尤为重要。
2、学生选课管理系统的组成本系统包括首页,系统公告,学生选课,教师查看,系统管理,系统帮助,联系我们7个部分。
“首页”主要是介绍衡水学院的基本情况。
“系统公告”介绍最近的一些新闻和通知,方面同学们及时了解。
“学生选课”是为学生提供选课界面。该界面要列出搜有课程信息供学生查询和选课。包括未选课程,已选课程,学生选课受一些条件的约束,如课程名额限制,该界面允许学生选课和修改退选。
“教师查看”教师可以查看学生选课情况,有详细的选课名单。
“系统管理”主要是按指定系检索该系的学生信息,维护学生,系,课程和学生选课及成绩等方面基本信息,包括增加,删除,修改
“系统帮助”主要是帮助学生能更好及时的完成选课任务。
3、系统实现
采用了ASP.NET结合SQL Server2008数据库,即将学生选课的有关数据库存放在选用的SQL Server2008作为后台的数据库。
运行环境硬件与网络环境:用服务器能运行Windows XP及以上操作系统。
第三篇:网上购物系统外文翻译
重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
重庆三峡学院 毕业设计(论文)
文献综述和外文翻译
设计(论文)题目
网上购物系统设计与实现
学
院:
计算机科学与工程学院
专
业:
软件工程
年
级:
2008级
姓
名:
肖伟
指导教师:
朱丙丽
完成日期:
2011 年 12 月 29 日 重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
文献综述
摘要: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浏览器不能直接与数据库进行会话。即使它能够做到这一点,为了安全上的考虑,我们也不希望让它这么做。对应大多数其他应用重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
程序,也存在类似的问题。因此,我们需要Web中间层从HTTP流中提取输入数据,与应用程序会话,并将结果嵌入到文档中。(4)向客户发送显式数据(即文档)。
这个文档可以用各种格式发送,包括文本(HTML或XML),二进制(GIF图),甚至可以式建立在其他底层格式之上的压缩格式,如gzip。但是,到目前为止,HTML式最常用的格式,故而servelt和JSP的重要任务之一就式将结果包装到HTML中。(5)发送隐式的HTTP响应数据。
图1.1中显示了一条从Web中间层到客户端的单箭头。但是,实际发送的数据有两种:文档本身,以及后台的HTTP信息。同样,两种数据对开发来说都式至关重要的。HTTP响应数据的发送过程涉及告知浏览器或其他客户程序所返回文档的类型(如HTML),设置cookie和缓存参数,以及其他类似的任务。1.2动态构建网页的原因
预先建立的文档可以满足客户的许多请求,服务器无需调用servlet就可以处理这些请求。然而,许多情况下静态的结果不能满足要求,我们需要针对每个请求生成一个页面。实时构建页面的理由有很多种:
1、网页基于客户发送的数据。
例如,搜索引擎生成的页面,以及在线商店的订单确认页面,都要针对特定的用户请求而产生。在没有读取到用户提交的数据之前,我们不知道应该显示什么。要记住,用户提交两种类型的数据:显示(即HTML表单的数据)和隐式(即HTTP请求的报头)。两种输入都可用来构建输出页面。基于cookie值针对具体用户构建页面的情况尤其普遍。
2、页面由频繁改变的数据导出。
如果页面需要根据每个具体的请求做出相应的改变,当然需要在请求发生时构建响应。但是,如果页面周期性地改变,我们可以用两种方式来处理它:周期性地在服务器上构建新的页面(和客户请求无关),或者仅仅在用户请求该页面时再构建。具体应该采用哪种方式要根据具体情况而定,但后一种方式常常更为方便,因为它只需简单地等待用户的请求。例如,天气预报或新闻网站可能会动态地构建页面,也有可能会返回之前构建的页面(如果它还是最新的话)。
重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
3、页面中使用了来自公司数据库或其他数据库断数据源的信息。
如果数据存储在数据库中,那么,即使客户端使用动态Web内容,比如applet,我们依旧需要执行服务器端处理。想象以下,如果一个搜索引擎网站完全使用applet,那么用户将会看到:“正在下载50TB的applet,请等待!”。显然,这样很愚蠢;这种情况下,我们需要与数据库进行会话。从客户端到Web层再到数据库(三层结构),要比从applet直接到数据库(二层结构)更灵活,也更安全,而性能上的损失很少甚至没有。毕竟数据库调用通常是对速度影响最大的步骤,因而,经过中间层可以执行高速缓存和连接共享。
理论上讲,servelt并非只用于处理HTTP请求的Web服务器或应用服务器,它同样可以用于其他类型的服务器。例如,servlet能够嵌入到FTP或邮件服务器中,扩展他们的功能。而且,用于会话启动协议服务器的servlet API最近已经被标准化(参见http://jcp.org/en/jsr/detail?id=116)。但在实践中,servelt的这种用法尚不流行,在此,我们只论述HTTP Servlet。1.3 Servlet相对于“传统”CGI的优点
和传统CGI及许多类CGI技术相比,Java servelt效率更高、更易用、更强大、更容易移植、更安全、也更廉价。
1、效率
应用传统的CGI,针对每个HTTP请求都用启动一个新的进程。如果CGI程序自身相对比较简短,那么启动进程的开销会占用大部分执行时间。而使用servelt,Java虚拟机会一直运行,并用轻量级的Java线程处理每个请求,而非重量级的操作系统进程。类似地,应用传统的CGI技术,如果存在对同一CGI程序的N个请求,那么CGI程序的代码会载入内存N次。同样的情况,如果使用servlet则启动N个线程,单仅仅载入servlet类的单一副本。这种方式减少了服务器的内存需求,通过实例化更少的对象从而节省了时间。最后,当CGI程序结束对请求的处理之后,程序结束。这种方式难以缓存计算结果,保持数据库连接打开,或是执行依靠持续性数据的其他优化。然而,servelt会一直停留在内存中(即使请求处理完毕),因而可以直接存储客户请求之间的任意复杂数据。
2、便利
Servelt提供大量的基础构造,可以自动分析和解码HTML的表单数据,读取和设置 重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
HTTP报头,处理cookie,跟踪会话,以及其他次类高级功能。而在CGI中,大部分工作都需要我们资金完成。另外,如果您已经了解了Java编程语言,为什么还有学校Perl呢?您已经承认应用Java技术编写的代码要比Visual Basic,VBScript或C++编写的代码更可靠,且更易重用,为什么还有倒退回去选择那些语言来开发服务器端的程序呢?
3、强大
Servlet支持常规CGI难以实现或根本不能实现的几项功能。Servlet能够直接于Web服务器对话,而常规的CGI程序做不到这一点,至少在不使用服务器专有API的情况下是这样。例如,与Web服务器的通信使得讲相对URL转换成具体的路径名变得更为容易。多个servelt还可以共享数据,从而易于实现数据库连接共享和类似的资源共享优化。Servelt还能维护请求之间的信息,使得诸如会话跟踪和计算结果缓存等技术变得更为简单。
4、可移植性
Servelt使用Java编程语言,并且遵循标准的API。所有主要的Web服务器。实际上都直接或通过插件支持servlet。因此。为Macromedia JRun编写的servlet,可以不经过任何修改地在Apache Tomcat,Microsoft Internet Information Server,IBM WebSphere。iPlanet Enterprise Server。Oracle9i AS 或者StrNine WebStar上运行。他们是java2平台企业版的一部分,所以对servlet的支持越来越普遍。
5、廉价
对于开发用的网站、低容量或中等容量网站的部署,有大量免费或极为廉价的Web服务器可供选择。因此,通过使用servelt和jsp,我们可以从免费或廉价的服务器开始,在项目获得初步成功后,在移植到更高性能或高级管理工具的昂贵的服务器上。这与其他CGI方案形成鲜明的对比,这些CGI方案在初期都需要为购买专利软件包投入大量的资金。
价格和可移植性在某种程度上是相互关联的。例如,Marty记录了所有通过电子邮件向他发送问题的读者的所在国。印度接近列表的顶端,可能仅次于美国。Marty曾在马尼拉讲授过jsp和servlet培训课程,那儿对servelt和jsp技术抱很大的兴趣。
那么,为什么印度和菲律宾都对这项技术着呢感兴趣呢?我们推测答案可能分两部分。首先,这两个国家都拥有大量训练有素的软件开发人员。其次,这两个国家的货币
重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
对美元的汇率都极为不利。因此,从美国公司那里购买专用Web服务器会消耗掉项目的大部分前期资金。
但是,使用servlet 和JSP,他们能够从免费的服务器开始:Apache Tomcat。项目取得成功之后,他们可以转移到性能更高、管理更容易,但需要付费的服务器。他们的servelt和jsp不需要重写编写。如果他们的项目变得更庞大,他们或许希望转移到分布式环境。没有问题:他们可以转而使用Macromedia JRun Professional,该服务器支持分布式应用。同样,他们的servelt和jsp没有任何部分需要重写。如果项目变得极为庞大,错综复杂,他们或许希望使用Enterprise JavaBeans来封装他们的商业逻辑。因此,他们可以切换到BEA WebLogic或Oracle9i AS。同样,不需要对servlet和jsp做出更改。最后,如果他们的项目变得更庞大,他们或许将他从Linux转移到运行IBM WebSphere的IBM大型机上。他们还是不需要做出任何更改。
6、安全
传统CGI程序中主要的漏洞来源之一就是,CGI程序常常由通过的操作系统外壳来执行。因此,CGI程序必须仔细地过滤掉那些可能被外壳特殊处理的字符,如反引导和分号。实现这项预防措施的难度可能超出我们的想象,在广泛应用的CGI库中,不断发现由这类问题引发的弱点。
问题的第二个来源是,一些CGI程序用不自动检查数组和字符串边界的语言编写而成。例如,在C和C++中,可以分配一个100个元素的数组,然后向第999个“元素“写入数据——实际上是程序内存的随机部分,这完全合法。因而,如果程序员忘记执行这项检查,就会将系统暴露在蓄意或偶然的缓冲区溢出攻击之下。
Servelt不存在这些问题。即使servelt执行系统调用激活本地操作系统上的程序,它也不会用到外壳来完成这项任务。当然,数组边界的检查以及其他内存包含特性是java编程语言的核心部分。
7、主流
虽然存在许多很好的技术,但是,如果提供商助支持他们,或开发人员不知道如何使用这些技术,那么它们的优点又如何体现呢?servelt和jsp技术得到服务器提供商的广泛支持,包括Apache,Oracle,IBM,Sybase,BEA,Maromedia,Causho,Sun/iPlanet,New Atlanta,ATG,Fujitsu,Lutris,Silverstream,World Wide Web Consortinrm,以及其他服务器。存在几种低廉的插件,通过应用这些插件,Microsoft IIS和Zeus 重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
也同样支持servlet和jsp技术,它们运行在Windows,Unix/Linus,MacOS,VMS,和IBM大型机操作系统之上。它们用在航空业、电子商务、在线银行、web搜索引擎、门户、大型金融网站、以及成百上千您日常光顾的其他网站。
当然,仅仅是流行并不能证明技术的优越性。很多泛美的例子。但我们的立场是:服务器端Java本非一项新的、为经证实的技术。
An Overview of Servlet and JSP Technology Abstract: Servlet program running in the server-side, dynamically generated Web page with the traditional CGI and many other similar compared to CGI technology, Java Servlet with a more efficient, easier to use, more powerful and has better portability, more savings to invest.Key words: JSP Technology, Servlet, HTTP server
1.1 A Servlet's Job Servlets are Java programs that run on Web or application servers, acting as a middle layer between requests coming from Web browsers or other HTTP clients and databases or applications on the HTTP server.Their job is to perform the following tasks, as illustrated in Figure 1-1.Figure 1-1 1.Read the explicit data sent by the client.The end user normally enters this data in an HTML form on a Web page.However, the data could also come from an applet or a custom HTTP client program.2.Read the implicit HTTP request data sent by the browser.Figure 1-1 shows a single arrow going from the client to the Web server(the layer where servlets and JSP execute), but there are really two varieties of data: the explicit data that the end user enters in a form and the behind-the-scenes HTTP information.Both varieties are critical.The HTTP information includes cookies, information about media types and compression schemes the browser understands, and so on.3.Generate the results.This process may require talking to a database, executing an RMI or EJB call, invoking a Web service, or computing the response directly.Your real data may be in a relational database.Fine.But your database probably doesn't speak HTTP or return results in HTML, so the Web browser can't talk directly to the database.6 重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
Even if it could, for security reasons, you probably would not want it to.The same argument applies to most other applications.You need the Web middle layer to extract the results inside a document.4.Send the explicit data(i.e., the document)to the client.This document can be sent in a variety of formats, including text(HTML or XML), binary(GIF images), or even a compressed format like gzip that is layered on top of some other underlying format.But, HTML is by far the most common format, so an important servlet/JSP task is to wrap the results inside of HTML.5.Send the implicit HTTP response data.Figure 1-1 shows a single arrow going from the Web middle layer(the servlet or JSP page)to the client.But, there are really two varieties of data sent: the document itself and the behind-the-scenes HTTP information.Again, both varieties are critical to effective development.Sending HTTP response data involves telling the browser or other client what type of document is being returned(e.g., HTML), setting cookies and caching parameters, and other such tasks.1.2 Why Build Web Pages Dynamically? many client requests can be satisfied by prebuilt documents, and the server would handle these requests without invoking servlets.In many cases, however, a static result is not sufficient, and a page needs to be generated for each request.There are a number of reasons why Web pages need to be built on-the-fly: 1. The Web page is based on data sent by the client.For instance, the results page from search engines and order-confirmation pages at online stores are specific to particular user requests.You don't know what to display until you read the data that the user submits.Just remember that the user submits two kinds of data: explicit(i.e., HTML form data)and implicit(i.e., HTTP request headers).Either kind of input can be used to build the output page.In particular, it is quite common to build a user-specific page based on a cookie value.2.The Web page is derived from data that changes frequently.If the page changes for every request, then you certainly need to build the response at request time.If it changes only periodically, however, you could do it two ways: you could periodically build a new Web page on the server(independently of client requests), or you could wait and only build the page when the user requests it.The right approach depends on the situation, but sometimes it is more convenient to do the latter: wait for the user request.For example, a weather report or news headlines site might build the pages dynamically, perhaps returning a previously built page if that page is still up to date.重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
3.The Web page uses information from corporate databases or other server-side sources.If the information is in a database, you need server-side processing even if the client is using dynamic Web content such as an applet.Imagine using an applet by itself for a search engine site: “Downloading 50 terabyte applet, please wait!” Obviously, that is silly;you need to talk to the database.Going from the client to the Web tier to the database(a three-tier approach)instead of from an applet directly to a database(a two-tier approach)provides increased flexibility and security with little or no performance penalty.After all, the database call is usually the rate-limiting step, so going through the Web server does not slow things down.In fact, a three-tier approach is often faster because the middle tier can perform caching and connection pooling.In principle, servlets are not restricted to Web or application servers that handle HTTP requests but can be used for other types of servers as well.For example, servlets could be embedded in FTP or mail servers to extend their functionality.And, a servlet API for SIP(Session Initiation Protocol)servers was recently standardized(see http://jcp.org/en/jsr/detail?id=116).In practice, however, this use of servlets has not caught on, and we'll only be discussing HTTP servlets.1.3 The Advantages of Servlets Over “Traditional” CGI Java servlets are more efficient, easier to use, more powerful, more portable, safer, and cheaper than traditional CGI and many alternative CGI-like technologies.1.Efficient With traditional CGI, a new process is started for each HTTP request.If the CGI program itself is relatively short, the overhead of starting the process can dominate the execution time.With servlets, the Java virtual machine stays running and handles each request with a lightweight Java thread, not a heavyweight operating system process.Similarly, in traditional CGI, if there are N requests to the same CGI program, the code for the CGI program is loaded into memory N times.With servlets, however, there would be N threads, but only a single copy of the servlet class would be loaded.This approach reduces server memory requirements and saves time by instantiating fewer objects.Finally, when a CGI program finishes handling a request, the program terminates.This approach makes it difficult to cache computations, keep database connections open, and perform other optimizations that rely on persistent data.Servlets, however, remain in memory even after they complete a response, so it is straightforward to store arbitrarily complex data between client requests.2.Convenient Servlets have an extensive infrastructure for automatically parsing and
重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
decoding HTML form data, reading and setting HTTP headers, handling cookies, tracking sessions, and many other such high-level utilities.In CGI, you have to do much of this yourself.Besides, if you already know the Java programming language, why learn Perl too? You're already convinced that Java technology makes for more reliable and reusable code than does Visual Basic, VBScript, or C++.Why go back to those languages for server-side programming? 3.Powerful Servlets support several capabilities that are difficult or impossible to accomplish with regular CGI.Servlets can talk directly to the Web server, whereas regular CGI programs cannot, at least not without using a server-specific API.Communicating with the Web server makes it easier to translate relative URLs into concrete path names, for instance.Multiple servlets can also share data, making it easy to implement database connection pooling and similar resource-sharing optimizations.Servlets can also maintain information from request to request, simplifying techniques like session tracking and caching of previous computations.4.Portable Servlets are written in the Java programming language and follow a standard API.Servlets are supported directly or by a plugin on virtually every major Web server.Consequently, servlets written for, say, Macromedia JRun can run virtually unchanged on Apache Tomcat, Microsoft Internet Information Server(with a separate plugin), IBM WebSphere, iPlanet Enterprise Server, Oracle9i AS, or StarNine WebStar.They are part of the Java 2 Platform, Enterprise Edition(J2EE;see http://java.sun.com/j2ee/), so industry support for servlets is becoming even more pervasive.5.Inexpensive A number of free or very inexpensive Web servers are good for development use or deployment of low-or medium-volume Web sites.Thus, with servlets and JSP you can start with a free or inexpensive server and migrate to more expensive servers with high-performance capabilities or advanced administration utilities only after your project meets initial success.This is in contrast to many of the other CGI alternatives, which require a significant initial investment for the purchase of a proprietary package.Price and portability are somewhat connected.For example, Marty tries to keep track of the countries of readers that send him questions by email.India was near the top of the list, probably #2 behind the U.S.Marty also taught one of his JSP and servlet training courses(see http://courses.coreservlets.com/)in Manila, and there was great interest in servlet and JSP technology there.Now, why are India and the Philippines both so interested? We surmise that the answer is twofold.First, both countries have large pools of well-educated software developers.Second, both countries have(or had, at that time)highly 重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
unfavorable currency exchange rates against the U.S.dollar.So, buying a special-purpose Web server from a U.S.company consumed a large part of early project funds.But, with servlets and JSP, they could start with a free server: Apache Tomcat(either standalone, embedded in the regular Apache Web server, or embedded in Microsoft IIS).Once the project starts to become successful, they could move to a server like Caucho Resin that had higher performance and easier administration but that is not free.But none of their servlets or JSP pages have to be rewritten.If their project becomes even larger, they might want to move to a distributed(clustered)environment.No problem: they could move to Macromedia JRun Professional, which supports distributed applications(Web farms).Again, none of their servlets or JSP pages have to be rewritten.If the project becomes quite large and complex, they might want to use Enterprise JavaBeans(EJB)to encapsulate their business logic.So, they might switch to BEA WebLogic or Oracle9i AS.Again, none of their servlets or JSP pages have to be rewritten.Finally, if their project becomes even bigger, they might move it off of their Linux box and onto an IBM mainframe running IBM WebSphere.But once again, none of their servlets or JSP pages have to be rewritten.6.Secure One of the main sources of vulnerabilities in traditional CGI stems from the fact that the programs are often executed by general-purpose operating system shells.So, the CGI programmer must be careful to filter out characters such as backquotes and semicolons that are treated specially by the shell.Implementing this precaution is harder than one might think, and weaknesses stemming from this problem are constantly being uncovered in widely used CGI libraries.A second source of problems is the fact that some CGI programs are processed by languages that do not automatically check array or string bounds.For example, in C and C++ it is perfectly legal to allocate a 100-element array and then write into the 999th “element,” which is really some random part of program memory.So, programmers who forget to perform this check open up their system to deliberate or accidental buffer overflow attacks.Servlets suffer from neither of these problems.Even if a servlet executes a system call(e.g., with Runtime.exec or JNI)to invoke a program on the local operating system, it does not use a shell to do so.And, of course, array bounds checking and other memory protection features are a central part of the Java programming language.7.Mainstream There are a lot of good technologies out there.But if vendors don't support them and developers don't know how to use them, what good are they? Servlet and JSP technology is supported by servers from Apache, Oracle, IBM, Sybase, BEA,10 重庆三峡学院毕业设计外文翻译[肖伟]-网上购物系统设计与实现
Macromedia, Caucho, Sun/iPlanet, New Atlanta, ATG, Fujitsu, Lutris, Silverstream, the World Wide Web Consortium(W3C), and many others.Several low-cost plugins add support to Microsoft IIS and Zeus as well.They run on Windows, Unix/Linux, MacOS, VMS, and IBM mainframe operating systems.They are the single most popular application of the Java programming language.They are arguably the most popular choice for developing medium to large Web applications.They are used by the airline industry(most United Airlines and Delta Airlines Web sites), e-commerce(ofoto.com), online banking(First USA Bank, Banco Popular de Puerto Rico), Web search engines/portals(excite.com), large financial sites(American Century Investments), and hundreds of other sites that you visit every day.Of course, popularity alone is no proof of good technology.Numerous counter-examples abound.But our point is that you are not experimenting with a new and unproven technology when you work with server-side Java.
第四篇:毕业设计外文翻译
外文原文
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.ASp.NET 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 ASp.NET 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 Java 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 servletServlet compiledServlet loaded into server's memoryjspInit called_jspService called
page first written
Request 1YesYesYesYesYes
Request 2NoNoNoNoYes
Server restarted
Request 3NoNoYesYesYes
Request 4NoNoNoNoYes
page modified
Request 5YesYesYesYesYes
Request 6NoNoNoNoYes
中文翻译
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精心设计的一项技术。ASp.NET是与servlets和JSp直接竞争的技术。JSp的优势体现在两个方面。
首先,JSp可以移植到多种操作系统和Web服务器,您不必仅仅局限于部署在Windows 和IIS上尽管核心.NET平台可以在好几种非Windows平台上运行,但ASp这一部分不可以。您不能期望可以将重要的ASp.NET应用部署到多种服务器和操作系统。对于某些应用,这种差异没有什么影响。但有些应用,这种差异却非常重要。
其次,对于某些应用,底层语言的选择至关重要。例如,尽管.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的一般规则。
表1列出一些常见的情形,讲述在该种情况下每一步是否发生。最常被误解的项已经突出标示出来。在参考该表时,要注意,由JSp页面生成的servlet使用_jspService方法(GET和pOST请求都调用该函数),不是doGet或dopost方法。同样,对于初始化,它们使用jspInit方法,而非init方法。
表1 各种情况下的JSp操作
将JSp 页面转换成servlet编译Servlet 将Servlet 载入到服务器内存中调用jspInit 调用_jspService
页面初次创建
请求 1有有有有有
请求 2无无无无有
服务器重启后
请求3无无有有有
请求 4无无无无有
页面修改后
请求 5有有有有有
请求 6无无无无有
第五篇:基于ASP的网上书店系统毕业设计任务书
毕业设计任务书
基于ASP的网上书店系统毕业设计任务书
指导教师:李芳莹设计日期:2011年11月28日-2012年2月7日
一、设计题目:
基于ASP的网上书店系统
二、设计任务要求
1、系统设计环境
(1)操作系统:Windows 2000、Windows XP、vista、7操作系统。
(2)使用语言:ASP、HTML;
(3)使用数据库:ACCESS、SQL SERVER;
2、熟悉软件工程的各个过程,熟悉软件测试和数据库测试的方法。
3、掌握系统设计,数据库设计常用的方法。
4、掌握数据库的安装和网络配置的方法。
5、程序代码编写要规范。
6、掌握脚本的生成方法和帮助文件的生成方法。
7、熟悉电子商务的基本知识,掌握常用B/S系统的设计、编写方法。
8、重点放在网站的设计,而不是网页设计上。
三、设计进度及安排
1、需求分析阶段(1周)
2、系统规化设计阶段(3周)
3、毕业设计阶段(3周)
4、毕业答辩阶段(1周)
四、设计成品要求
1、软件实际上机运行,实现基本功能,并且有一定可扩展性。
2、设计成果存入光盘。
3、毕业设计论文。