第一篇:畢業(yè)設(shè)計(jì)網(wǎng)上選課系統(tǒng)ASP外文翻譯
論文題目姓名學(xué)號(hào)班級(jí)年級(jí)專(zhuān)業(yè)學(xué)院指導(dǎo)教師完成時(shí)間
外文翻譯
(一)網(wǎng)上選課系統(tǒng)
軟件工程
軟件學(xué)院
2014年 5 月13日
: : : : : : : : :
東華理工大學(xué)畢業(yè)設(shè)計(jì)(外文翻譯)
英文原文
英文原文
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 東華理工大學(xué)畢業(yè)設(shè)計(jì)(外文翻譯)
英文原文
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東華理工大學(xué)畢業(yè)設(shè)計(jì)(外文翻譯)
英文原文
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 東華理工大學(xué)畢業(yè)設(shè)計(jì)(外文翻譯)
英文原文
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.東華理工大學(xué)畢業(yè)設(shè)計(jì)(外文翻譯)
英文原文
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 東華理工大學(xué)畢業(yè)設(shè)計(jì)(外文翻譯)
英文原文
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.東華理工大學(xué)畢業(yè)設(shè)計(jì)(外文翻譯)
漢語(yǔ)翻譯
漢語(yǔ)翻譯
Active Server Pages(ASP)是服務(wù)器端腳本編寫(xiě)環(huán)境,使用它可以創(chuàng)建和運(yùn)行動(dòng)態(tài)、交互的 Web 服務(wù)器應(yīng)用程序。使用 ASP 可以組合 HTML 頁(yè)、腳本命令和 ActiveX 組件以創(chuàng)建交互的 Web 頁(yè)和基于 Web 的功能強(qiáng)大的應(yīng)用程序。ASP 應(yīng)用程序很容易開(kāi)發(fā)和修改。1.ASP的工作原理
當(dāng)在Web站點(diǎn)中融入ASP功能后,將發(fā)生以下事情:
(1)用戶(hù)向?yàn)g覽器地址欄輸入網(wǎng)址,默認(rèn)頁(yè)面的擴(kuò)展名是.asp;
(2)瀏覽器向服務(wù)器發(fā)出請(qǐng)求;
(3)服務(wù)器引擎開(kāi)始運(yùn)行ASP程序;
(4)ASP文件按照從上到下的順序開(kāi)始處理,執(zhí)行腳本命令,執(zhí)行HTML頁(yè)面內(nèi)容;
(5)頁(yè)面信息發(fā)送到瀏覽器;
2.ASP的運(yùn)行環(huán)境
ASP需要運(yùn)行在PWS或IIS下。PWS或IIS服務(wù)在windows98或windows2000的光盤(pán)上附帶著,可以通過(guò)“添加/刪除程序”中的“添加/刪除windows組件”來(lái)安裝。
一般asp需與access數(shù)據(jù)庫(kù)或SQL Server數(shù)據(jù)庫(kù)結(jié)合使用,編出功能強(qiáng)大的程序。能夠運(yùn)行ASP的web服務(wù)器軟件:
Windows2000默認(rèn)安裝的是IIS5.0(internet information server),而windows XP默認(rèn)安裝的是IIS5.1,windows 2003默認(rèn)安裝的IIS6.0。
PWS(personal web server)運(yùn)行在windows98環(huán)境下的簡(jiǎn)單個(gè)人網(wǎng)頁(yè)服務(wù)器。3.ASP的意義與特性
ASP(Application Service Provider,應(yīng)用軟體租賃服務(wù)提供者)是指“透過(guò)網(wǎng)路以租賃方式提供應(yīng)用軟體服務(wù)的業(yè)者”,即業(yè)者以應(yīng)用軟體為主體,透過(guò)網(wǎng)路一對(duì)多地傳遞服務(wù),這種以服務(wù)為主的交易模式促使企業(yè)可藉由租賃的方式,以更符合成本效益的方式擁有軟體的使用權(quán),并且亦能因?yàn)闃I(yè)者集中式的管理而大幅降低企業(yè)維護(hù)的成本。
基本上,ASP即具有“軟體服務(wù)化,服務(wù)網(wǎng)路化”,“資訊委外服務(wù)與網(wǎng)路結(jié)合”與“產(chǎn)品通路化,通路產(chǎn)品化”等三大特性,甚至可以被視為是ISP(Internet Service Provider)與ITS(Information Technology Service)的結(jié)合。
ASP的英文是Application Service Provider,中文的標(biāo)準(zhǔn)翻譯就是“應(yīng)用服務(wù)提供商”,是指為商業(yè)或者個(gè)人客戶(hù)提供管理應(yīng)用解決方案的公司或者企業(yè)。最近ASP被媒體炒作的十分火熱,不是IT行業(yè)的人面對(duì)一堆技術(shù)名詞專(zhuān)業(yè)術(shù)語(yǔ)很 東華理工大學(xué)畢業(yè)設(shè)計(jì)(外文翻譯)
漢語(yǔ)翻譯
難弄清楚ASP的內(nèi)容,本文試圖用淺顯的語(yǔ)言來(lái)為廣大的讀者揭開(kāi)ASP神秘的面紗,對(duì)于IT行業(yè)的大熱門(mén)ASP領(lǐng)域有一些基本的認(rèn)識(shí)。
4.ASP的起源
對(duì)于ASP模式和ASP企業(yè)起源的研究可以從兩個(gè)方面入手,一個(gè)是從業(yè)務(wù)和技術(shù)的角度,從ASP業(yè)務(wù)構(gòu)成的發(fā)展歷史來(lái)進(jìn)行研究;另一個(gè)是從組織機(jī)構(gòu)發(fā)展的角度,來(lái)研究目前ASP企業(yè)的由來(lái)和演化過(guò)程。
將上述發(fā)展階段綜合起來(lái),簡(jiǎn)單的說(shuō),目前的ASP提供商的歷史和發(fā)展道路可以簡(jiǎn)單的描述為:
第一類(lèi),從過(guò)去的ISP發(fā)展起來(lái),圍繞基礎(chǔ)設(shè)施和通訊功能,與軟件廠商合作,增加業(yè)務(wù)范圍,發(fā)展到現(xiàn)在的IDC(互聯(lián)網(wǎng)數(shù)據(jù)中心);
第二類(lèi),過(guò)去的ISV(獨(dú)立軟件提供商)和VAR(增值服務(wù)轉(zhuǎn)售商),在互聯(lián)網(wǎng)時(shí)代,改變過(guò)去的營(yíng)銷(xiāo)方式,將過(guò)去以軟件產(chǎn)品的出售為主轉(zhuǎn)向以使用權(quán)租賃為主,從物理載體的打包封裝方式轉(zhuǎn)向現(xiàn)在在線和遠(yuǎn)程運(yùn)行方式為主,通過(guò)與網(wǎng)絡(luò)運(yùn)營(yíng)商的合作,實(shí)現(xiàn)向ASP的轉(zhuǎn)型;
第三類(lèi),傳統(tǒng)的大型組織的IT服務(wù)部門(mén)和傳統(tǒng)的咨詢(xún)公司,在對(duì)于互聯(lián)網(wǎng)的深刻認(rèn)識(shí)的基礎(chǔ)上,依靠長(zhǎng)期的經(jīng)驗(yàn),開(kāi)始為其他客戶(hù)進(jìn)行系統(tǒng)方案的設(shè)計(jì)和實(shí)施,通過(guò)建立在與網(wǎng)絡(luò)運(yùn)行商和應(yīng)用軟件制造商之間的聯(lián)盟關(guān)系,實(shí)現(xiàn)以系統(tǒng)集成商身份出現(xiàn)的ASP提供商。5.ASP的發(fā)展歷史與分類(lèi)
從目前來(lái)看,ASP作為一種模式的正式誕生和提出只是在1998年底到1999年初之間的事情。而很大程度上直到1999年末到2000年初,ASP領(lǐng)域相關(guān)公司在資本市場(chǎng)上的突出表現(xiàn)才引起了人們的廣泛關(guān)注。實(shí)際上從ASP模式的內(nèi)涵和本質(zhì)上講,并不是全新的事物,而是曾經(jīng)有過(guò)的模式,在互聯(lián)網(wǎng)時(shí)代被賦予了新的生命力。在本節(jié)中,我們將回顧ASP產(chǎn)生發(fā)展演變的過(guò)程,以幫助更好的深入理解ASP的本質(zhì)。在最后,我們將集中介紹目前ASP領(lǐng)域內(nèi)企業(yè)從不同標(biāo)準(zhǔn)進(jìn)行劃分的情況。
HTML 編寫(xiě)人員 如果您是位 HTML 編寫(xiě)人員,您將發(fā)現(xiàn) ASP 腳本提供了創(chuàng)建交互頁(yè)的簡(jiǎn)便方法。如果您曾想從 HTML 表格中收集數(shù)據(jù),或用顧客的姓名個(gè)人化 HTML 文件,或根據(jù)瀏覽器的不同使用不同的特性,您會(huì)發(fā)現(xiàn) ASP 提供了一個(gè)出色的解決方案。以前,要想從 HTML 表格中收集數(shù)據(jù),就不得不學(xué)習(xí)一門(mén)編程語(yǔ)言來(lái)創(chuàng)建一個(gè) CGI 應(yīng)用程序?,F(xiàn)在,您只要將一些簡(jiǎn)單的指令嵌入到您的 HTML 文件中,就可以從表格中收集數(shù)據(jù)并進(jìn)行分析。您再不必學(xué)習(xí)完整的編程語(yǔ)言或者單獨(dú)編譯程序來(lái)創(chuàng)建交互頁(yè)。東華理工大學(xué)畢業(yè)設(shè)計(jì)(外文翻譯)
漢語(yǔ)翻譯
隨著不斷掌握使用 ASP 和腳本語(yǔ)言的技巧,您可以創(chuàng)建更復(fù)雜的腳本。對(duì)于 ASP,您可以便捷地使用 ActiveX 組件來(lái)執(zhí)行復(fù)雜的任務(wù),比如連接數(shù)據(jù)庫(kù)以存儲(chǔ)和檢索信息。
如果您已經(jīng)掌握一門(mén)腳本語(yǔ)言,如 VBScript、JavaScript 或 PERL,而且您已經(jīng)了解使用 ASP 的方法。只要安裝了符合 ActiveX 腳本標(biāo)準(zhǔn)的相應(yīng)腳本引擎,就可以在 ASP 頁(yè)中使用任何一種腳本語(yǔ)言。ASP 帶有 Microsoft? Visual Basic? Scripting Edition(VBScript)和 Microsoft? Script? 的腳本引擎,這樣您可以立即開(kāi)始編輯腳本。PERL、REXX 和 Python 的 ActiveX 腳本引擎可以從第三方開(kāi)發(fā)人員處獲得。Web 開(kāi)發(fā)人員 如果您已經(jīng)掌握了一門(mén)編程語(yǔ)言,如 Visual Basic,您將發(fā)現(xiàn) ASP 是快速創(chuàng)建 Web 應(yīng)用程序的一個(gè)非常靈活的方法。通過(guò)向 HTML 中添加腳本命令,您能夠創(chuàng)建應(yīng)用程序的 HTML 接口。通過(guò)創(chuàng)建自己的 ActiveX 組件,可以將應(yīng)用程序中的商業(yè)邏輯封裝到能夠從腳本、其他組件或從其他程序中調(diào)用的模塊。
使用 ASP 進(jìn)行計(jì)算的 Web 可轉(zhuǎn)化為有形的利益,它使 Web 供應(yīng)商能夠提供交互的商業(yè)應(yīng)用而不僅僅是發(fā)布內(nèi)容。例如,旅行社能夠比公布航空時(shí)刻表做得更多;用 ASP 腳本可以讓客戶(hù)察看現(xiàn)有的航班、比較費(fèi)用并預(yù)定座位。
包含在 Windows NT Option pack 中的 Microsoft Transaction Server(MTS)可以降低在服務(wù)器上構(gòu)造程序的復(fù)雜性和費(fèi)用。TS 可以解決開(kāi)發(fā)那些保密性強(qiáng)的、可分級(jí)的
以及可靠的 Web 應(yīng)用程序的復(fù)雜性問(wèn)題。6.Active Server Pages模型
瀏覽器從 Web 服務(wù)器上請(qǐng)求.asp 文件時(shí),然后 Web ASP 腳本開(kāi)始運(yùn)行。服務(wù)器調(diào)用 ASP,執(zhí)行所有腳本命令,并將 Web 頁(yè)ASP 全面讀取請(qǐng)求的文件,傳送給瀏覽器。
由于腳本在服務(wù)器上而不是在客戶(hù)端運(yùn)行,傳送到瀏覽器上的 Web 頁(yè)是在 Web 服務(wù)器上生成的。所以不必?fù)?dān)心瀏覽器能否處理腳本:Web 服務(wù)器已經(jīng)完成了所有腳本的處理,并將標(biāo)準(zhǔn)的 HTML 傳輸?shù)綖g覽器。由于只有腳本的結(jié)果返回到瀏覽器,所以服務(wù)器端腳本不易復(fù)制。用戶(hù)看不到創(chuàng)建他們正在瀏覽的頁(yè)的腳本命令。
我們將介紹著名數(shù)據(jù)庫(kù)語(yǔ)言的SQL的基本形式。SQL是允許我們查詢(xún)和操作關(guān)于計(jì)算機(jī)化的關(guān)系數(shù)據(jù)庫(kù)系統(tǒng)的語(yǔ)言。從80 年代初期,SQL就一直是關(guān)系數(shù)據(jù)庫(kù)管理系統(tǒng)的語(yǔ)言,而且它是有著重要的意義的在對(duì)許多概念中,都在本文 東華理工大學(xué)畢業(yè)設(shè)計(jì)(外文翻譯)
漢語(yǔ)翻譯
里提到。當(dāng)前,SQL語(yǔ)言是從關(guān)系形式(ANSI SQL-92 標(biāo)準(zhǔn))轉(zhuǎn)向一個(gè)新的對(duì)象關(guān)系形式(ANSI SLQ-99,1999 被發(fā)布)。SQL-99 是SQL-92的延伸,它不改變所有早期版本的優(yōu)秀的語(yǔ)言。通常,我們嚴(yán)格定義的基本SQL與ANSI SQL 標(biāo)準(zhǔn)和基礎(chǔ)子集十分類(lèi)似,分別被認(rèn)為就是ENTRY SQL-92 和CORE SQL-99。我們也介紹了ENTRY SQL-92、CORE SQL-99之外一些廣泛實(shí)現(xiàn)的特性。在定義基本的SQL中,我們的試金石是將提供一種支持大多RDBMS 接口的語(yǔ)法。
首先,我們總的研究SQL的特性,然后對(duì)SQL的多種形式標(biāo)準(zhǔn)和產(chǎn)品語(yǔ)言以及我們將如何具體地處理這些標(biāo)準(zhǔn)和產(chǎn)品語(yǔ)言進(jìn)行分析解釋。
我們知道了怎樣完成關(guān)系代數(shù)來(lái)回應(yīng)對(duì)查詢(xún)的數(shù)據(jù)庫(kù)信息。這將讓我們看到,在編寫(xiě)查詢(xún)語(yǔ)句時(shí)SQL中的SELECT在很多方面都比關(guān)系代數(shù)強(qiáng)大。但是,二者在性能上相比較,SQL在本質(zhì)上并沒(méi)有明顯的改進(jìn)。對(duì)那些周密的擴(kuò)展語(yǔ)法來(lái)說(shuō),沒(méi)有關(guān)系代數(shù)所不能實(shí)現(xiàn)的。所以,關(guān)系代數(shù)查詢(xún)方面的經(jīng)驗(yàn)就能成為SQL查詢(xún)的很好的借鑒。同時(shí)在許多方面,SQL語(yǔ)句和關(guān)系代數(shù)概念模型又有著相當(dāng)大的差異,而可以通過(guò)熟悉、理解關(guān)系代數(shù)增強(qiáng)對(duì)SQL的理解。
最重要的SQL特性是它擁有在計(jì)算機(jī)輸出的條件下能夠相互地構(gòu)造查詢(xún)的能力。SQL的SELECT語(yǔ)句比簡(jiǎn)單的關(guān)系代數(shù)更難,但只要能夠上機(jī)實(shí)踐,只需幾個(gè)典型實(shí)驗(yàn)就收回你的懷疑。我們所談?wù)摰慕换ナ江h(huán)境是你在電腦上一輸入一個(gè)查詢(xún)語(yǔ)句并且立即執(zhí)行,就可以看到結(jié)果。此情況說(shuō)明了這樣一個(gè)事實(shí),一個(gè)SQL 的SELECT語(yǔ)句是在打入一些輸入行之后立即形成的,并且對(duì)一個(gè)用戶(hù)來(lái)說(shuō)該語(yǔ)句與前面的任何交互操作都沒(méi)有關(guān)系。這種不依賴(lài)于用戶(hù)會(huì)話互相通信操作的性質(zhì)也被稱(chēng)作非過(guò)程性。在這方面SQL也與關(guān)系代數(shù)不同,因?yàn)樵陉P(guān)系代數(shù)中為了表示一個(gè)表與自身的笛卡兒積,在表前面可能需要定義表別名。SQL與比如JAVA或C之類(lèi)的語(yǔ)言之間的差別十分巨大的:你不需要為了實(shí)現(xiàn)一個(gè)SQL查詢(xún)的功能而編寫(xiě)一個(gè)程序,你只需要量輸入較短的、獨(dú)立的查詢(xún)語(yǔ)句,然后運(yùn)行就可以了。
當(dāng)然,SQL查詢(xún)可能會(huì)復(fù)雜。為此,我們列出了SELECT語(yǔ)句的完整形式。取出這個(gè)形式的一個(gè)部分的查詢(xún)被稱(chēng)為子查詢(xún),對(duì)它的定義是遞歸的,完整的SELECT語(yǔ)句形式只有一個(gè)子句。無(wú)論如何,你不應(yīng)恐懼復(fù)雜的SQL語(yǔ)句。在使用菜單的應(yīng)SELECT語(yǔ)句的非過(guò)程性說(shuō)明了它與使用菜單的應(yīng)用十分相似。用中,用戶(hù)需要從菜單中填寫(xiě)一組數(shù)據(jù),然后按下回車(chē)來(lái)對(duì)它們立即執(zhí)行。但并不是所有SELECT語(yǔ)句的各種子句對(duì)于菜單選項(xiàng)有時(shí)也會(huì)需要所有的子句,的子句在每次查詢(xún)的時(shí)候都用上。東華理工大學(xué)畢業(yè)設(shè)計(jì)(外文翻譯)
漢語(yǔ)翻譯
觀察可靠性應(yīng)考慮系統(tǒng)使用環(huán)境。依照已經(jīng)討論的內(nèi)容,系統(tǒng)環(huán)境無(wú)法預(yù)先被描述,系統(tǒng)設(shè)計(jì)者也不可能對(duì)系統(tǒng)工作環(huán)境做過(guò)多限制。不同的系統(tǒng)對(duì)相同環(huán)境中的同樣問(wèn)題還可能有無(wú)法預(yù)料的反應(yīng),所有這些都影響系統(tǒng)的可靠性。因此,即使在系統(tǒng)被集成之后,它的可靠性也是難以精確測(cè)量的。7.Visual Basic訪問(wèn)數(shù)據(jù)庫(kù)的前景:
近來(lái)隨著Web應(yīng)用軟件的迅速發(fā)展和現(xiàn)有數(shù)據(jù)存儲(chǔ)形式的多種多樣,Visual Basic訪問(wèn)數(shù)據(jù)庫(kù)的解決方案面臨諸如快速提取分布于企業(yè)內(nèi)部和外部有用商業(yè)信息等的多種挑戰(zhàn)。為此Microsoft提出一種新的數(shù)據(jù)庫(kù)訪問(wèn)策略,即“統(tǒng)一數(shù)據(jù)訪問(wèn)”(Universal Data Access)的策略。“統(tǒng)一數(shù)據(jù)訪問(wèn)”提供了高性能的存取包括關(guān)系型和非關(guān)系型在內(nèi)的多種數(shù)據(jù)源,提供獨(dú)立于開(kāi)發(fā)工具和開(kāi)發(fā)語(yǔ)言的簡(jiǎn)單的編程接口,這些技術(shù)使得企業(yè)集成多種數(shù)據(jù)源、選擇更好的開(kāi)發(fā)工具、應(yīng)用軟件、操作平臺(tái)、建立容易維護(hù)的解決方案成為可能。
第二篇:網(wǎng)上選課系統(tǒng)畢業(yè)設(shè)計(jì)總結(jié)
網(wǎng)上選課系統(tǒng)總結(jié)
1、前言
隨著社會(huì)的發(fā)展,學(xué)生培養(yǎng)計(jì)劃已不再一成不變,各個(gè)學(xué)校紛紛推出了面向全體學(xué)生的選課服務(wù),這項(xiàng)旨在為大家提供一個(gè)更加寬松自由而且更符合學(xué)生意愿的服務(wù)已成為當(dāng)代學(xué)生過(guò)程中不可缺少的一部分。正式計(jì)算機(jī)技術(shù)的迅速發(fā)展使得人們從過(guò)去復(fù)雜的手工勞動(dòng)中得以解脫,從而使這種服務(wù)在現(xiàn)在才可能迅速普及,同時(shí)編寫(xiě)一套完整的學(xué)生信息顯得尤為重要。
2、學(xué)生選課管理系統(tǒng)的組成本系統(tǒng)包括首頁(yè),系統(tǒng)公告,學(xué)生選課,教師查看,系統(tǒng)管理,系統(tǒng)幫助,聯(lián)系我們7個(gè)部分。
“首頁(yè)”主要是介紹衡水學(xué)院的基本情況。
“系統(tǒng)公告”介紹最近的一些新聞和通知,方面同學(xué)們及時(shí)了解。
“學(xué)生選課”是為學(xué)生提供選課界面。該界面要列出搜有課程信息供學(xué)生查詢(xún)和選課。包括未選課程,已選課程,學(xué)生選課受一些條件的約束,如課程名額限制,該界面允許學(xué)生選課和修改退選。
“教師查看”教師可以查看學(xué)生選課情況,有詳細(xì)的選課名單。
“系統(tǒng)管理”主要是按指定系檢索該系的學(xué)生信息,維護(hù)學(xué)生,系,課程和學(xué)生選課及成績(jī)等方面基本信息,包括增加,刪除,修改
“系統(tǒng)幫助”主要是幫助學(xué)生能更好及時(shí)的完成選課任務(wù)。
3、系統(tǒng)實(shí)現(xiàn)
采用了ASP.NET結(jié)合SQL Server2008數(shù)據(jù)庫(kù),即將學(xué)生選課的有關(guān)數(shù)據(jù)庫(kù)存放在選用的SQL Server2008作為后臺(tái)的數(shù)據(jù)庫(kù)。
運(yùn)行環(huán)境硬件與網(wǎng)絡(luò)環(huán)境:用服務(wù)器能運(yùn)行Windows XP及以上操作系統(tǒng)。
第三篇:網(wǎng)上購(gòu)物系統(tǒng)外文翻譯
重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
重慶三峽學(xué)院 畢業(yè)設(shè)計(jì)(論文)
文獻(xiàn)綜述和外文翻譯
設(shè)計(jì)(論文)題目
網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
學(xué)
院:
計(jì)算機(jī)科學(xué)與工程學(xué)院
專(zhuān)
業(yè):
軟件工程
年
級(jí):
2008級(jí)
姓
名:
肖偉
指導(dǎo)教師:
朱丙麗
完成日期:
2011 年 12 月 29 日 重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
文獻(xiàn)綜述
摘要:Servlet程序在服務(wù)器端運(yùn)行,動(dòng)態(tài)地生成Web頁(yè)面與傳統(tǒng)的CGI和許多其他類(lèi)似CGI的技術(shù)相比,Java Servlet具有更高的效率,更容易使用,功能更強(qiáng)大,具有更好的可移植性,更節(jié)省投資。
關(guān)鍵字:JSP技術(shù),Servlet,HTTP服務(wù) 1.1Servlet的功能
Servlets是運(yùn)行在Web或應(yīng)用服務(wù)器上的Java程序,它是一個(gè)中間層,負(fù)責(zé)連接來(lái)自Web瀏覽器或其他HTTP客戶(hù)程序的請(qǐng)求和HTTP服務(wù)器上的數(shù)據(jù)庫(kù)或應(yīng)用程序。Servlet的工作是執(zhí)行西門(mén)的任務(wù),如圖1.1所示。
圖1.1Web中間件的作用
(1)讀取客戶(hù)發(fā)送的顯式數(shù)據(jù)。
最終用戶(hù)一般在頁(yè)面的HTML表單中輸入這些數(shù)據(jù)。然而,數(shù)據(jù)還有可能來(lái)自applet或定制的HTTP客戶(hù)程序。
(2)讀取由瀏覽器發(fā)送的隱式請(qǐng)求數(shù)據(jù)。
圖1.1中顯示了一條從客戶(hù)端到Web服務(wù)器的單箭頭,但實(shí)際上從客戶(hù)端傳送到Web服務(wù)器的數(shù)據(jù)有兩種,它們分別為用戶(hù)在表單中輸入的顯式數(shù)據(jù),以及后臺(tái)的HTTP信息。兩種數(shù)據(jù)都很重要。HTTP信息包括cookie、瀏覽器所能識(shí)別的媒體類(lèi)型和壓縮模式等。
(3)生成結(jié)果。
這個(gè)過(guò)程可能需要訪問(wèn)數(shù)據(jù)庫(kù)、執(zhí)行RMI或EJB調(diào)用、調(diào)用Web服務(wù),或者直接計(jì)算得出對(duì)應(yīng)的響應(yīng)。實(shí)際的數(shù)據(jù)可能存儲(chǔ)在關(guān)系型數(shù)據(jù)庫(kù)中。該數(shù)據(jù)庫(kù)可能不理解HTTP,或者不能返回HTML形式的結(jié)果,所有Web瀏覽器不能直接與數(shù)據(jù)庫(kù)進(jìn)行會(huì)話。即使它能夠做到這一點(diǎn),為了安全上的考慮,我們也不希望讓它這么做。對(duì)應(yīng)大多數(shù)其他應(yīng)用重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
程序,也存在類(lèi)似的問(wèn)題。因此,我們需要Web中間層從HTTP流中提取輸入數(shù)據(jù),與應(yīng)用程序會(huì)話,并將結(jié)果嵌入到文檔中。(4)向客戶(hù)發(fā)送顯式數(shù)據(jù)(即文檔)。
這個(gè)文檔可以用各種格式發(fā)送,包括文本(HTML或XML),二進(jìn)制(GIF圖),甚至可以式建立在其他底層格式之上的壓縮格式,如gzip。但是,到目前為止,HTML式最常用的格式,故而servelt和JSP的重要任務(wù)之一就式將結(jié)果包裝到HTML中。(5)發(fā)送隱式的HTTP響應(yīng)數(shù)據(jù)。
圖1.1中顯示了一條從Web中間層到客戶(hù)端的單箭頭。但是,實(shí)際發(fā)送的數(shù)據(jù)有兩種:文檔本身,以及后臺(tái)的HTTP信息。同樣,兩種數(shù)據(jù)對(duì)開(kāi)發(fā)來(lái)說(shuō)都式至關(guān)重要的。HTTP響應(yīng)數(shù)據(jù)的發(fā)送過(guò)程涉及告知瀏覽器或其他客戶(hù)程序所返回文檔的類(lèi)型(如HTML),設(shè)置cookie和緩存參數(shù),以及其他類(lèi)似的任務(wù)。1.2動(dòng)態(tài)構(gòu)建網(wǎng)頁(yè)的原因
預(yù)先建立的文檔可以滿(mǎn)足客戶(hù)的許多請(qǐng)求,服務(wù)器無(wú)需調(diào)用servlet就可以處理這些請(qǐng)求。然而,許多情況下靜態(tài)的結(jié)果不能滿(mǎn)足要求,我們需要針對(duì)每個(gè)請(qǐng)求生成一個(gè)頁(yè)面。實(shí)時(shí)構(gòu)建頁(yè)面的理由有很多種:
1、網(wǎng)頁(yè)基于客戶(hù)發(fā)送的數(shù)據(jù)。
例如,搜索引擎生成的頁(yè)面,以及在線商店的訂單確認(rèn)頁(yè)面,都要針對(duì)特定的用戶(hù)請(qǐng)求而產(chǎn)生。在沒(méi)有讀取到用戶(hù)提交的數(shù)據(jù)之前,我們不知道應(yīng)該顯示什么。要記住,用戶(hù)提交兩種類(lèi)型的數(shù)據(jù):顯示(即HTML表單的數(shù)據(jù))和隱式(即HTTP請(qǐng)求的報(bào)頭)。兩種輸入都可用來(lái)構(gòu)建輸出頁(yè)面。基于cookie值針對(duì)具體用戶(hù)構(gòu)建頁(yè)面的情況尤其普遍。
2、頁(yè)面由頻繁改變的數(shù)據(jù)導(dǎo)出。
如果頁(yè)面需要根據(jù)每個(gè)具體的請(qǐng)求做出相應(yīng)的改變,當(dāng)然需要在請(qǐng)求發(fā)生時(shí)構(gòu)建響應(yīng)。但是,如果頁(yè)面周期性地改變,我們可以用兩種方式來(lái)處理它:周期性地在服務(wù)器上構(gòu)建新的頁(yè)面(和客戶(hù)請(qǐng)求無(wú)關(guān)),或者僅僅在用戶(hù)請(qǐng)求該頁(yè)面時(shí)再構(gòu)建。具體應(yīng)該采用哪種方式要根據(jù)具體情況而定,但后一種方式常常更為方便,因?yàn)樗恍韬?jiǎn)單地等待用戶(hù)的請(qǐng)求。例如,天氣預(yù)報(bào)或新聞網(wǎng)站可能會(huì)動(dòng)態(tài)地構(gòu)建頁(yè)面,也有可能會(huì)返回之前構(gòu)建的頁(yè)面(如果它還是最新的話)。
重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
3、頁(yè)面中使用了來(lái)自公司數(shù)據(jù)庫(kù)或其他數(shù)據(jù)庫(kù)斷數(shù)據(jù)源的信息。
如果數(shù)據(jù)存儲(chǔ)在數(shù)據(jù)庫(kù)中,那么,即使客戶(hù)端使用動(dòng)態(tài)Web內(nèi)容,比如applet,我們依舊需要執(zhí)行服務(wù)器端處理。想象以下,如果一個(gè)搜索引擎網(wǎng)站完全使用applet,那么用戶(hù)將會(huì)看到:“正在下載50TB的applet,請(qǐng)等待!”。顯然,這樣很愚蠢;這種情況下,我們需要與數(shù)據(jù)庫(kù)進(jìn)行會(huì)話。從客戶(hù)端到Web層再到數(shù)據(jù)庫(kù)(三層結(jié)構(gòu)),要比從applet直接到數(shù)據(jù)庫(kù)(二層結(jié)構(gòu))更靈活,也更安全,而性能上的損失很少甚至沒(méi)有。畢竟數(shù)據(jù)庫(kù)調(diào)用通常是對(duì)速度影響最大的步驟,因而,經(jīng)過(guò)中間層可以執(zhí)行高速緩存和連接共享。
理論上講,servelt并非只用于處理HTTP請(qǐng)求的Web服務(wù)器或應(yīng)用服務(wù)器,它同樣可以用于其他類(lèi)型的服務(wù)器。例如,servlet能夠嵌入到FTP或郵件服務(wù)器中,擴(kuò)展他們的功能。而且,用于會(huì)話啟動(dòng)協(xié)議服務(wù)器的servlet API最近已經(jīng)被標(biāo)準(zhǔn)化(參見(jiàn)http://jcp.org/en/jsr/detail?id=116)。但在實(shí)踐中,servelt的這種用法尚不流行,在此,我們只論述HTTP Servlet。1.3 Servlet相對(duì)于“傳統(tǒng)”CGI的優(yōu)點(diǎn)
和傳統(tǒng)CGI及許多類(lèi)CGI技術(shù)相比,Java servelt效率更高、更易用、更強(qiáng)大、更容易移植、更安全、也更廉價(jià)。
1、效率
應(yīng)用傳統(tǒng)的CGI,針對(duì)每個(gè)HTTP請(qǐng)求都用啟動(dòng)一個(gè)新的進(jìn)程。如果CGI程序自身相對(duì)比較簡(jiǎn)短,那么啟動(dòng)進(jìn)程的開(kāi)銷(xiāo)會(huì)占用大部分執(zhí)行時(shí)間。而使用servelt,Java虛擬機(jī)會(huì)一直運(yùn)行,并用輕量級(jí)的Java線程處理每個(gè)請(qǐng)求,而非重量級(jí)的操作系統(tǒng)進(jìn)程。類(lèi)似地,應(yīng)用傳統(tǒng)的CGI技術(shù),如果存在對(duì)同一CGI程序的N個(gè)請(qǐng)求,那么CGI程序的代碼會(huì)載入內(nèi)存N次。同樣的情況,如果使用servlet則啟動(dòng)N個(gè)線程,單僅僅載入servlet類(lèi)的單一副本。這種方式減少了服務(wù)器的內(nèi)存需求,通過(guò)實(shí)例化更少的對(duì)象從而節(jié)省了時(shí)間。最后,當(dāng)CGI程序結(jié)束對(duì)請(qǐng)求的處理之后,程序結(jié)束。這種方式難以緩存計(jì)算結(jié)果,保持?jǐn)?shù)據(jù)庫(kù)連接打開(kāi),或是執(zhí)行依靠持續(xù)性數(shù)據(jù)的其他優(yōu)化。然而,servelt會(huì)一直停留在內(nèi)存中(即使請(qǐng)求處理完畢),因而可以直接存儲(chǔ)客戶(hù)請(qǐng)求之間的任意復(fù)雜數(shù)據(jù)。
2、便利
Servelt提供大量的基礎(chǔ)構(gòu)造,可以自動(dòng)分析和解碼HTML的表單數(shù)據(jù),讀取和設(shè)置 重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
HTTP報(bào)頭,處理cookie,跟蹤會(huì)話,以及其他次類(lèi)高級(jí)功能。而在CGI中,大部分工作都需要我們資金完成。另外,如果您已經(jīng)了解了Java編程語(yǔ)言,為什么還有學(xué)校Perl呢?您已經(jīng)承認(rèn)應(yīng)用Java技術(shù)編寫(xiě)的代碼要比Visual Basic,VBScript或C++編寫(xiě)的代碼更可靠,且更易重用,為什么還有倒退回去選擇那些語(yǔ)言來(lái)開(kāi)發(fā)服務(wù)器端的程序呢?
3、強(qiáng)大
Servlet支持常規(guī)CGI難以實(shí)現(xiàn)或根本不能實(shí)現(xiàn)的幾項(xiàng)功能。Servlet能夠直接于Web服務(wù)器對(duì)話,而常規(guī)的CGI程序做不到這一點(diǎn),至少在不使用服務(wù)器專(zhuān)有API的情況下是這樣。例如,與Web服務(wù)器的通信使得講相對(duì)URL轉(zhuǎn)換成具體的路徑名變得更為容易。多個(gè)servelt還可以共享數(shù)據(jù),從而易于實(shí)現(xiàn)數(shù)據(jù)庫(kù)連接共享和類(lèi)似的資源共享優(yōu)化。Servelt還能維護(hù)請(qǐng)求之間的信息,使得諸如會(huì)話跟蹤和計(jì)算結(jié)果緩存等技術(shù)變得更為簡(jiǎn)單。
4、可移植性
Servelt使用Java編程語(yǔ)言,并且遵循標(biāo)準(zhǔn)的API。所有主要的Web服務(wù)器。實(shí)際上都直接或通過(guò)插件支持servlet。因此。為Macromedia JRun編寫(xiě)的servlet,可以不經(jīng)過(guò)任何修改地在Apache Tomcat,Microsoft Internet Information Server,IBM WebSphere。iPlanet Enterprise Server。Oracle9i AS 或者StrNine WebStar上運(yùn)行。他們是java2平臺(tái)企業(yè)版的一部分,所以對(duì)servlet的支持越來(lái)越普遍。
5、廉價(jià)
對(duì)于開(kāi)發(fā)用的網(wǎng)站、低容量或中等容量網(wǎng)站的部署,有大量免費(fèi)或極為廉價(jià)的Web服務(wù)器可供選擇。因此,通過(guò)使用servelt和jsp,我們可以從免費(fèi)或廉價(jià)的服務(wù)器開(kāi)始,在項(xiàng)目獲得初步成功后,在移植到更高性能或高級(jí)管理工具的昂貴的服務(wù)器上。這與其他CGI方案形成鮮明的對(duì)比,這些CGI方案在初期都需要為購(gòu)買(mǎi)專(zhuān)利軟件包投入大量的資金。
價(jià)格和可移植性在某種程度上是相互關(guān)聯(lián)的。例如,Marty記錄了所有通過(guò)電子郵件向他發(fā)送問(wèn)題的讀者的所在國(guó)。印度接近列表的頂端,可能僅次于美國(guó)。Marty曾在馬尼拉講授過(guò)jsp和servlet培訓(xùn)課程,那兒對(duì)servelt和jsp技術(shù)抱很大的興趣。
那么,為什么印度和菲律賓都對(duì)這項(xiàng)技術(shù)著呢感興趣呢?我們推測(cè)答案可能分兩部分。首先,這兩個(gè)國(guó)家都擁有大量訓(xùn)練有素的軟件開(kāi)發(fā)人員。其次,這兩個(gè)國(guó)家的貨幣
重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
對(duì)美元的匯率都極為不利。因此,從美國(guó)公司那里購(gòu)買(mǎi)專(zhuān)用Web服務(wù)器會(huì)消耗掉項(xiàng)目的大部分前期資金。
但是,使用servlet 和JSP,他們能夠從免費(fèi)的服務(wù)器開(kāi)始:Apache Tomcat。項(xiàng)目取得成功之后,他們可以轉(zhuǎn)移到性能更高、管理更容易,但需要付費(fèi)的服務(wù)器。他們的servelt和jsp不需要重寫(xiě)編寫(xiě)。如果他們的項(xiàng)目變得更龐大,他們或許希望轉(zhuǎn)移到分布式環(huán)境。沒(méi)有問(wèn)題:他們可以轉(zhuǎn)而使用Macromedia JRun Professional,該服務(wù)器支持分布式應(yīng)用。同樣,他們的servelt和jsp沒(méi)有任何部分需要重寫(xiě)。如果項(xiàng)目變得極為龐大,錯(cuò)綜復(fù)雜,他們或許希望使用Enterprise JavaBeans來(lái)封裝他們的商業(yè)邏輯。因此,他們可以切換到BEA WebLogic或Oracle9i AS。同樣,不需要對(duì)servlet和jsp做出更改。最后,如果他們的項(xiàng)目變得更龐大,他們或許將他從Linux轉(zhuǎn)移到運(yùn)行IBM WebSphere的IBM大型機(jī)上。他們還是不需要做出任何更改。
6、安全
傳統(tǒng)CGI程序中主要的漏洞來(lái)源之一就是,CGI程序常常由通過(guò)的操作系統(tǒng)外殼來(lái)執(zhí)行。因此,CGI程序必須仔細(xì)地過(guò)濾掉那些可能被外殼特殊處理的字符,如反引導(dǎo)和分號(hào)。實(shí)現(xiàn)這項(xiàng)預(yù)防措施的難度可能超出我們的想象,在廣泛應(yīng)用的CGI庫(kù)中,不斷發(fā)現(xiàn)由這類(lèi)問(wèn)題引發(fā)的弱點(diǎn)。
問(wèn)題的第二個(gè)來(lái)源是,一些CGI程序用不自動(dòng)檢查數(shù)組和字符串邊界的語(yǔ)言編寫(xiě)而成。例如,在C和C++中,可以分配一個(gè)100個(gè)元素的數(shù)組,然后向第999個(gè)“元素“寫(xiě)入數(shù)據(jù)——實(shí)際上是程序內(nèi)存的隨機(jī)部分,這完全合法。因而,如果程序員忘記執(zhí)行這項(xiàng)檢查,就會(huì)將系統(tǒng)暴露在蓄意或偶然的緩沖區(qū)溢出攻擊之下。
Servelt不存在這些問(wèn)題。即使servelt執(zhí)行系統(tǒng)調(diào)用激活本地操作系統(tǒng)上的程序,它也不會(huì)用到外殼來(lái)完成這項(xiàng)任務(wù)。當(dāng)然,數(shù)組邊界的檢查以及其他內(nèi)存包含特性是java編程語(yǔ)言的核心部分。
7、主流
雖然存在許多很好的技術(shù),但是,如果提供商助支持他們,或開(kāi)發(fā)人員不知道如何使用這些技術(shù),那么它們的優(yōu)點(diǎn)又如何體現(xiàn)呢?servelt和jsp技術(shù)得到服務(wù)器提供商的廣泛支持,包括Apache,Oracle,IBM,Sybase,BEA,Maromedia,Causho,Sun/iPlanet,New Atlanta,ATG,F(xiàn)ujitsu,Lutris,Silverstream,World Wide Web Consortinrm,以及其他服務(wù)器。存在幾種低廉的插件,通過(guò)應(yīng)用這些插件,Microsoft IIS和Zeus 重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
也同樣支持servlet和jsp技術(shù),它們運(yùn)行在Windows,Unix/Linus,MacOS,VMS,和IBM大型機(jī)操作系統(tǒng)之上。它們用在航空業(yè)、電子商務(wù)、在線銀行、web搜索引擎、門(mén)戶(hù)、大型金融網(wǎng)站、以及成百上千您日常光顧的其他網(wǎng)站。
當(dāng)然,僅僅是流行并不能證明技術(shù)的優(yōu)越性。很多泛美的例子。但我們的立場(chǎng)是:服務(wù)器端Java本非一項(xiàng)新的、為經(jīng)證實(shí)的技術(shù)。
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 重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
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.重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
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
重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
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 重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
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 重慶三峽學(xué)院畢業(yè)設(shè)計(jì)外文翻譯[肖偉]-網(wǎng)上購(gòu)物系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
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.
第四篇:畢業(yè)設(shè)計(jì)外文翻譯
外文原文
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技術(shù)概述
一、JSp的好處
JSp頁(yè)面最終會(huì)轉(zhuǎn)換成servler。因而,從根本上,JSp頁(yè)面能夠執(zhí)行的任何任務(wù)都可以用servler來(lái)完成。然而,這種底層的等同性并不意味著servler和JSp頁(yè)面對(duì)于所有的情況都等同適用。問(wèn)題不在于技術(shù)的能力,而是二者在便利性、生產(chǎn)率和可維護(hù)性上的不同。畢竟,在特定平臺(tái)上能夠用Java編程語(yǔ)言完成的事情,同樣可以用匯編語(yǔ)言來(lái)完成,但是選擇哪種語(yǔ)言依舊十分重要。
和單獨(dú)使用servler相比,JSp提供下述好處:
?JSp中HTML的編寫(xiě)與維護(hù)更為簡(jiǎn)單。JSp中可以使用常規(guī)的HTML:沒(méi)有額外的反斜杠,沒(méi)有額外的雙引號(hào),也沒(méi)有暗含的Java語(yǔ)法。
?能夠使用標(biāo)準(zhǔn)的網(wǎng)站開(kāi)發(fā)工具。即使對(duì)那些對(duì)JSp一無(wú)所知的HTML工具,我們也可以使用,因?yàn)樗鼈儠?huì)忽略JSp標(biāo)簽(JSp tags)。
?可以對(duì)開(kāi)發(fā)團(tuán)隊(duì)進(jìn)行劃分。Java程序員可以致力于動(dòng)態(tài)代碼。Web開(kāi)發(fā)人員可以將經(jīng)理集中在表示層(presentation layer)上。對(duì)于大型的項(xiàng)目,這種劃分極為重要。依據(jù)開(kāi)發(fā)團(tuán)隊(duì)的大小,及項(xiàng)目的復(fù)雜程度,可以對(duì)靜態(tài)HTML和動(dòng)態(tài)內(nèi)容進(jìn)行弱分離(weaker separation)和強(qiáng)分離(stronger separation)。
在此,這個(gè)討論并不是讓您停止使用servlets,只使用JSp。幾乎所有的項(xiàng)目都會(huì)同時(shí)用到這兩種技術(shù)。針對(duì)項(xiàng)目中的某些請(qǐng)求,您可能會(huì)在MVC構(gòu)架下組合使用這兩項(xiàng)技術(shù)。我們總是希望用適當(dāng)?shù)墓ぞ咄瓿上鄬?duì)應(yīng)的工作,僅僅是servlet并不能填滿(mǎn)您的工具箱。
二、JSp相對(duì)于競(jìng)爭(zhēng)技術(shù)的優(yōu)勢(shì)
許多年前,Marty受到邀請(qǐng),參加一個(gè)有關(guān)軟件技術(shù)的小型(20個(gè)人)研討會(huì).做在Marty旁邊的人是James Gosling---Java編程語(yǔ)言的發(fā)明者。隔幾個(gè)位置,是來(lái)自華盛頓一家大型軟件公司的高級(jí)經(jīng)理。在討論過(guò)程中,研討會(huì)的主席提出了Jini的議題,這在當(dāng)時(shí)是一項(xiàng)新的Java技術(shù).主席向該經(jīng)理詢(xún)問(wèn)他的想法.他繼續(xù)說(shuō),他們會(huì)持續(xù)關(guān)注這項(xiàng)技術(shù),如果這項(xiàng)技術(shù)變得流行起來(lái),他們會(huì)遵循公司的“接受并擴(kuò)充(embrace and extend)”的策略.此時(shí), Gosling隨意地插話說(shuō)“你的意思其實(shí)就是不接受且不擴(kuò)充(disgrace and distend)?!?/p>
在此, Gosling的抱怨顯示出,他感到這個(gè)公司會(huì)從其他公司那里拿走技術(shù),用于他們自己的目的.但你猜這次怎么樣?這次鞋子穿在了另一只腳上。Java社團(tuán)沒(méi)有發(fā)明這一思想----將頁(yè)面設(shè)計(jì)成由靜態(tài)HTML和用特殊標(biāo)簽標(biāo)記的動(dòng)態(tài)代碼混合組成.。ColdFusion多年前就已經(jīng)這樣做了。甚至ASp(來(lái)自于前述經(jīng)理所在公司的一項(xiàng)產(chǎn)品)都在JSp出現(xiàn)之前推廣了這種方式。實(shí)際上,JSp不只采用了這種通用概念,它甚至使用許多和ASp相同的特殊標(biāo)簽。
因此,問(wèn)題變成:為什么使用JSp,而不使用其他技術(shù)呢?我們的第一反應(yīng)是我們不是在爭(zhēng)論所有的人應(yīng)該做什么。其他這些技術(shù)中,有一些也很不錯(cuò),在某些情況下也的確是合情合理的選擇.然而,在其他情形中,JSp明顯要更好一些。下面給出幾個(gè)理由。
與.NET和Active Server pages(ASp)相比
.NET是Microsoft精心設(shè)計(jì)的一項(xiàng)技術(shù)。ASp.NET是與servlets和JSp直接競(jìng)爭(zhēng)的技術(shù)。JSp的優(yōu)勢(shì)體現(xiàn)在兩個(gè)方面。
首先,JSp可以移植到多種操作系統(tǒng)和Web服務(wù)器,您不必僅僅局限于部署在Windows 和IIS上盡管核心.NET平臺(tái)可以在好幾種非Windows平臺(tái)上運(yùn)行,但ASp這一部分不可以。您不能期望可以將重要的ASp.NET應(yīng)用部署到多種服務(wù)器和操作系統(tǒng)。對(duì)于某些應(yīng)用,這種差異沒(méi)有什么影響。但有些應(yīng)用,這種差異卻非常重要。
其次,對(duì)于某些應(yīng)用,底層語(yǔ)言的選擇至關(guān)重要。例如,盡管.NET的C#語(yǔ)言設(shè)計(jì)優(yōu)良,且和Java類(lèi)似,但熟悉核心C#語(yǔ)法和眾多工具庫(kù)的程序員很少。此外,許多開(kāi)發(fā)者依舊使用最初版本的ASp。相對(duì)于這個(gè)版本,JSp在動(dòng)態(tài)代碼方面擁有明顯的優(yōu)勢(shì)。使用JSp,動(dòng)態(tài)部分是用Java編寫(xiě)的,而非VBScript過(guò)其他ASp專(zhuān)有的語(yǔ)言,因此JSp更為強(qiáng)勁,更適合于要求組件重用的復(fù)雜應(yīng)用。
當(dāng)將JSp與之前版本的ColdFusion對(duì)比時(shí),您可能會(huì)得到相同的結(jié)論。應(yīng)用JSp,您可以使用Java編寫(xiě)“真正的代碼”,不必依賴(lài)于特定的服務(wù)器產(chǎn)品。然而,當(dāng)前版本的ColdFusion滿(mǎn)足J2EE服務(wù)器的環(huán)境,允許開(kāi)發(fā)者容易的混合使用ColdFusion和Servlet/JSp代碼。
與pHp相比
pHp(“pHp:Hypertext preprocessor”的遞歸字母縮寫(xiě)詞)是免費(fèi)的、開(kāi)放源代碼的、HTML嵌入其中的腳本語(yǔ)言,與ASp和JSp都有某種程度的類(lèi)似。JSp的一項(xiàng)優(yōu)勢(shì)是動(dòng)態(tài)部分用Java編寫(xiě),而Java已經(jīng)在聯(lián)網(wǎng)、數(shù)據(jù)庫(kù)訪問(wèn)、分布式對(duì)象等方面擁有廣泛的ApI,而pHp需要學(xué)習(xí)全新的、應(yīng)用相對(duì)廣泛的語(yǔ)言。JSp的第二項(xiàng)優(yōu)勢(shì)是,和pHp相比,JSp擁有極為廣泛的工具和服務(wù)器提供商的支持。
與純Servlet相比
原則上,JSp并沒(méi)有提供Servlet不能完成的功能。實(shí)際上,JSp文檔在后臺(tái)被自動(dòng)轉(zhuǎn)換成Servlet。但是編寫(xiě)(和修改)常規(guī)的HTML,要比無(wú)數(shù)println語(yǔ)句生成HTML要方便得多。另外,通過(guò)將表示與內(nèi)容分離,可以為不同的人分配不同的任務(wù):網(wǎng)頁(yè)設(shè)計(jì)人員使用熟悉的工具構(gòu)建HTML,要么為Servlet程序員留出空間插入動(dòng)態(tài)內(nèi)容,要么通過(guò)XML標(biāo)簽間接調(diào)用動(dòng)態(tài)內(nèi)容。
這是否表示您只可以學(xué)習(xí)JSp,將Servlet丟到一邊呢?當(dāng)然不是!由于以下4種原因,JSp開(kāi)發(fā)人員需要了解Servlet:
(1)JSp頁(yè)面會(huì)轉(zhuǎn)換成Servlet。不了解Servlet就無(wú)法知道JSp如何工作。
(2)JSp由靜態(tài)HTML、專(zhuān)用的JSp標(biāo)簽和Java代碼組成。哪種類(lèi)型的Java代碼呢?當(dāng)然是Servlet代碼!如果不了解Servlet編程,那么就無(wú)法編寫(xiě)這種代碼。
(3)一些任務(wù)用Servlet完成比用JSp來(lái)完成要好。JSp擅長(zhǎng)生成由大量組織有序的結(jié)構(gòu)化HTML或其他字符數(shù)據(jù)組成的頁(yè)面。Servlet擅長(zhǎng)生成二進(jìn)制數(shù)據(jù),構(gòu)建結(jié)構(gòu)多樣的頁(yè)面,以及執(zhí)行輸出很少或者沒(méi)有輸出的任務(wù)(比如重定向)。
(4)有些任務(wù)更適合于組合使用Servlet和JSp來(lái)完成,而非單獨(dú)使用Servlet或JSp。
與JavaScript相比
JavaScript和Java編程語(yǔ)言完全是兩碼事,前者一般用于在客戶(hù)端動(dòng)態(tài)生成HTML,在瀏覽器載入文檔時(shí)構(gòu)建網(wǎng)頁(yè)的部分內(nèi)容。這是一項(xiàng)有用的功能,一般與JSp的功能(只在服務(wù)器端運(yùn)行)并不發(fā)生重疊。和常規(guī)HTML頁(yè)面一樣,JSp頁(yè)面依舊可以包括用于JavaScript的SCRIpT標(biāo)簽。實(shí)際上,JSp甚至能夠用來(lái)動(dòng)態(tài)生成發(fā)送到客戶(hù)端的JavaScript。因此,JavaScript不是一項(xiàng)競(jìng)爭(zhēng)技術(shù),它是一項(xiàng)補(bǔ)充技術(shù)。
JavaScript也可以用在服務(wù)器端,最因人注意的是SUN ONE(以前的iplanet)、IIS和BroadVision服務(wù)器。然而,Java更為強(qiáng)大靈活、可靠且可移植。
與WebMacro和Velocity相比
JSp決非完美。許多人都曾指出過(guò)JSp中能夠改進(jìn)的功能。這是一件好事,JSp的優(yōu)勢(shì)之一是該規(guī)范由許多不同公司組成的社團(tuán)控制。因此,在后續(xù)版本中,這項(xiàng)技術(shù)能夠得到協(xié)調(diào)的改進(jìn)。
但是,一些組織已經(jīng)開(kāi)發(fā)出了基于Java的替代技術(shù),試圖彌補(bǔ)這些不足。據(jù)我們的判斷,這樣做是錯(cuò)誤的。使用擴(kuò)充JSp和Servlet技術(shù)的第三方工具,如Apache Structs,是一種很好的思路,只要該工具帶來(lái)的好處能夠補(bǔ)償工具帶來(lái)的額外復(fù)雜性。但是,試圖使用非標(biāo)準(zhǔn)的工具代替JSp則不理想。在選擇一項(xiàng)技術(shù)時(shí),需要權(quán)衡許多方面的因素:標(biāo)準(zhǔn)化、可移植性、集成性、行業(yè)支持和技術(shù)特性。對(duì)于JSp替代技術(shù)的爭(zhēng)論幾乎只是集中在技術(shù)特性上,而可移植性、標(biāo)準(zhǔn)化和集成性也十分重要。例如,Servlet和JSp規(guī)范為Web應(yīng)用定義了一個(gè)標(biāo)準(zhǔn)的目錄結(jié)構(gòu),并提供用于部署Web應(yīng)用的標(biāo)準(zhǔn)文件(.war文件)。所有JSp兼容的服務(wù)器必須支持這些標(biāo)準(zhǔn)。我們可以建立過(guò)濾器作用到任意樹(shù)木的Servlet和JSp頁(yè)面上,但不能用于非標(biāo)準(zhǔn)資源。Web應(yīng)用安全設(shè)置也同樣如此。
此外,業(yè)界對(duì)JSp和Servlet技術(shù)的巨大支持使得這兩項(xiàng)技術(shù)都有了巨大的進(jìn)步,從而減輕了對(duì)JSp的許多批評(píng)。例如,JSp標(biāo)準(zhǔn)標(biāo)簽庫(kù)和JSp 2.0表達(dá)式語(yǔ)言解決了兩種最廣泛的批評(píng):缺乏良好的迭代結(jié)構(gòu);不使用顯式的Java代碼或冗長(zhǎng)的jsp:useBean元素難以訪問(wèn)動(dòng)態(tài)結(jié)果。
三、對(duì)JSp的誤解
忘記JSp技術(shù)是服務(wù)器端技術(shù)
下面是Marty收到的一些典型問(wèn)題(大部分問(wèn)題不止一次的出現(xiàn))。
?我們的服務(wù)器正在運(yùn)行JDK1.4。我如何將Swing組件用到JSp頁(yè)面中呢?
?我如何將圖像放到JSp頁(yè)面中?我不知道讀取圖像文件應(yīng)該使用哪些Java I/O命令。
?Tomcat不支持JavaScript,當(dāng)用戶(hù)在圖像上移動(dòng)鼠標(biāo)時(shí),我如何使圖像突出顯示呢?
?我們的客戶(hù)使用不理解JSp的舊瀏覽器。我應(yīng)該怎么做?
?當(dāng)我們的客戶(hù)在瀏覽器中使用“View Source”(查看源代碼)時(shí),如何阻止他們看到JSp標(biāo)簽?
所有這些問(wèn)題都基于瀏覽器對(duì)服務(wù)器端的過(guò)程在有所了解的假定之上。但事實(shí)上瀏覽器并不了解服務(wù)器端的過(guò)程。因此:
?如果要將使用Swing組件的applet放到網(wǎng)頁(yè)中,重要的是瀏覽器的Java版本,和服務(wù)器的Java版本無(wú)關(guān)。如果瀏覽器支持Java 2平臺(tái),您可以使用正常的AppLET(或Java插件)標(biāo)簽,即使在服務(wù)器上使用了非Java技術(shù)也須如此。
?您不需要Java I/O來(lái)讀取圖像文件,您只需將圖像放在存儲(chǔ)Web資源的目錄中(即WEB-INF/classes向上兩級(jí)的目錄),并輸出一個(gè)正常的IMG標(biāo)簽。
?您應(yīng)該用SCRIpT標(biāo)簽,使用客戶(hù)端JavaScript創(chuàng)建在鼠標(biāo)下會(huì)更改的圖像,這不會(huì)由于服務(wù)器使用JSp而改變。
?瀏覽器根本不“支持”JSp----它們看到的只是JSp頁(yè)面的輸出。因此,如同對(duì)待靜態(tài)HTML頁(yè)面一樣,只需確保JSp輸出的HTML與瀏覽器兼容。
?當(dāng)然,您不需要采取什么措施來(lái)阻止客戶(hù)看到JSp標(biāo)簽,這些標(biāo)簽在服務(wù)器上進(jìn)行處理,發(fā)送給客戶(hù)的輸出中并不出現(xiàn)。
混淆轉(zhuǎn)換期間和請(qǐng)求期間
JSp頁(yè)面需要轉(zhuǎn)換成servlet。Servlet在編譯后,載入到服務(wù)器的內(nèi)容中,初始化并執(zhí)行。但是每一步發(fā)生在什么時(shí)候呢?要回答這個(gè)問(wèn)題,要記住以下兩點(diǎn):
?JSp頁(yè)面僅在修改后第一次被訪問(wèn)時(shí),才會(huì)被轉(zhuǎn)換成servlet并進(jìn)行編譯;
?載入到內(nèi)存中、初始化和執(zhí)行遵循servlet的一般規(guī)則。
表1列出一些常見(jiàn)的情形,講述在該種情況下每一步是否發(fā)生。最常被誤解的項(xiàng)已經(jīng)突出標(biāo)示出來(lái)。在參考該表時(shí),要注意,由JSp頁(yè)面生成的servlet使用_jspService方法(GET和pOST請(qǐng)求都調(diào)用該函數(shù)),不是doGet或dopost方法。同樣,對(duì)于初始化,它們使用jspInit方法,而非init方法。
表1 各種情況下的JSp操作
將JSp 頁(yè)面轉(zhuǎn)換成servlet編譯Servlet 將Servlet 載入到服務(wù)器內(nèi)存中調(diào)用jspInit 調(diào)用_jspService
頁(yè)面初次創(chuàng)建
請(qǐng)求 1有有有有有
請(qǐng)求 2無(wú)無(wú)無(wú)無(wú)有
服務(wù)器重啟后
請(qǐng)求3無(wú)無(wú)有有有
請(qǐng)求 4無(wú)無(wú)無(wú)無(wú)有
頁(yè)面修改后
請(qǐng)求 5有有有有有
請(qǐng)求 6無(wú)無(wú)無(wú)無(wú)有
第五篇:基于ASP的網(wǎng)上書(shū)店系統(tǒng)畢業(yè)設(shè)計(jì)任務(wù)書(shū)
畢業(yè)設(shè)計(jì)任務(wù)書(shū)
基于ASP的網(wǎng)上書(shū)店系統(tǒng)畢業(yè)設(shè)計(jì)任務(wù)書(shū)
指導(dǎo)教師:李芳瑩設(shè)計(jì)日期:2011年11月28日-2012年2月7日
一、設(shè)計(jì)題目:
基于ASP的網(wǎng)上書(shū)店系統(tǒng)
二、設(shè)計(jì)任務(wù)要求
1、系統(tǒng)設(shè)計(jì)環(huán)境
(1)操作系統(tǒng):Windows 2000、Windows XP、vista、7操作系統(tǒng)。
(2)使用語(yǔ)言:ASP、HTML;
(3)使用數(shù)據(jù)庫(kù):ACCESS、SQL SERVER;
2、熟悉軟件工程的各個(gè)過(guò)程,熟悉軟件測(cè)試和數(shù)據(jù)庫(kù)測(cè)試的方法。
3、掌握系統(tǒng)設(shè)計(jì),數(shù)據(jù)庫(kù)設(shè)計(jì)常用的方法。
4、掌握數(shù)據(jù)庫(kù)的安裝和網(wǎng)絡(luò)配置的方法。
5、程序代碼編寫(xiě)要規(guī)范。
6、掌握腳本的生成方法和幫助文件的生成方法。
7、熟悉電子商務(wù)的基本知識(shí),掌握常用B/S系統(tǒng)的設(shè)計(jì)、編寫(xiě)方法。
8、重點(diǎn)放在網(wǎng)站的設(shè)計(jì),而不是網(wǎng)頁(yè)設(shè)計(jì)上。
三、設(shè)計(jì)進(jìn)度及安排
1、需求分析階段(1周)
2、系統(tǒng)規(guī)化設(shè)計(jì)階段(3周)
3、畢業(yè)設(shè)計(jì)階段(3周)
4、畢業(yè)答辯階段(1周)
四、設(shè)計(jì)成品要求
1、軟件實(shí)際上機(jī)運(yùn)行,實(shí)現(xiàn)基本功能,并且有一定可擴(kuò)展性。
2、設(shè)計(jì)成果存入光盤(pán)。
3、畢業(yè)設(shè)計(jì)論文。