【正文】
ogramming language you could also do in assembly language. But it still matters which you choose. 大連交通大學(xué) 2021 屆本科生畢業(yè)設(shè)計(論文)外文翻譯 2 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 Website 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 plexity 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 bine them with the MVC architecture . You want the appropriate tool for the job, and servlets, by themselves, do not plete your toolkit. SOURCE OF JSP The technique of JSP of the pany of Sun, making the page of Web develop the personnel can use the HTML perhaps marking of XML to design to turn the end page with format. Use the perhaps small script future life of marking of JSP bees the dynamic state on the page contents.( the contents changes according to the claim of) The Java Servlet is a technical foundation of JSP, and the large Web applies the development of the procedure to need the Java Servlet to match with with the JSP and then can plete, this name of Servlet es from the Applet, the local translation method of now is a lot of, this book in order not to misconstruction, decide the direct adoption Servlet but don39。與SSJS 和 ASP 相比, JSP 具有更好的可擴(kuò)展性,并且它不專屬于任何一家廠商或某一特定的 Web 服務(wù)器。兩者都提供在 HTML 代碼中混合某種程序代碼、由語言引擎解釋執(zhí)行程序代碼的能力。 JSP 中可以使用常規(guī)的 HTML:沒有額外的反斜杠,沒有額外的雙引號,也沒有暗含的 Java 語法。 大連交通大學(xué) 2021 屆本科生畢業(yè)設(shè)計(論文)外文翻譯 8 此處的討論并不是說人們應(yīng)該放棄使用 servlet 而僅僅使用 JSP。許多 Web 服務(wù)器都支持 Servlet,即使不直接支持 Servlet 的 Web 服務(wù)器也可以通過附加的應(yīng)用服務(wù)器和模塊來支持 Servlet。 主席向該經(jīng)理詢問他的想法 .他 回答 說 ,雖然現(xiàn)在言之過早,但這看起來會是非常有前途的一項技術(shù)。像 SSJS 一樣,它也允許你將靜態(tài) HTML 內(nèi)容與服務(wù)器端腳本混合起來生成動態(tài)輸出。 一般來說,在實際的 JSP 引擎中, JSP 頁面在執(zhí)行時是編譯式,而不是解釋式的。然而,隨著時間的推移,人們認(rèn)識到這種方法不適于構(gòu)建大型的、可升級的 Web 應(yīng)用程序。這些技術(shù)使某領(lǐng)域內(nèi)的專家可以為本領(lǐng)域內(nèi)的垂直應(yīng)用編寫組件,而開發(fā)者可以直接拿來使用而不必掌握這一領(lǐng)域的專門技術(shù)。 JSP 代碼控制著進(jìn)行邏輯處理時與 JavaBeans 組件的交互,并在動態(tài)生成的、混合了靜態(tài) HTML 代碼的 HTML 頁中顯示結(jié)果。由于是 JSP 引擎自動生成并編譯 Servlet,不用程序員動手編譯代碼,所以 JSP 能帶給你高效的性能和快速開發(fā)所需的靈活性。對于分析員和設(shè)計人員,建模過程( the modeling process)變得更簡單而且可以創(chuàng)建一個有序而可控的設(shè)計。 1 Fortunately, this has change significantly with the advent of thirdparty libraries and Standard C++ library. 頁 40 It is, in fact, difficult to design objects wellfor that matter, it’s hard to design anything well. But the intent is that a relatively few experts design the best objects for others to OOP languages incorporate not just language syntax and a piler, but an entire development environment including a significant library of welldesigned , easy to use ,the primary job of most programmers is to use existing objects to solve their application problems. The goal of this chapter is to show you what objectoriented programming is and how simple it can be. 事實上,把設(shè)計對象好是一件很難的事情。 The progress of abstraction 抽象進(jìn)階 All programming languages provide abstractions. It can be argued that the plexity of the problems you can solve is directly related to the kind and quality of abstraction. By “kind” I mean : what is it that you are abstracting? Assembly language is a small abstraction of the underlying machine. Many socalled “imperative” languages that followed(such as FORTRAN, BASIC, and C)were abstractions of assembly language. These languages are big improvements over assembly language, but their primary abstraction still requires you to think in terms of structure of the puter rather than the structure of the problem you are trying to solve. The programmer must establish the association between the machine model(in the “solution space”) and the model of the problem that is actually being solved (in the “problem space”). The effort required to perform this mapping, and the fact that it is extrinsic to the programming language, produces programs that are difficult to write and expensive to maintain, and as a side effect created the entire “programming methods” industry. 所有的程序設(shè)計語言都提供了抽象。早期的語言如 LISP 和 APL 選擇特殊的對世界的視角( “所有的問題都是無限序列 ”或者 “所有的問題都可以用算法來表達(dá) ”)。這種概念允許程序去適應(yīng)它自己方言通過。語言被創(chuàng)造為基于約束的編程并且有專門用來操作圖形對象的編程。我之于 “kind”的定義是:那些你正在抽象的東西,比如說:匯編語言是一種針對于底層機器的小型抽象。這就是它的目的所在,讓相對很少的一部分專家去設(shè)計最好的對象,讓其余的人去使用它們。它將會使每個人都受益。首先,在速度上,傳統(tǒng)的 CGI 程序需要使 用系統(tǒng)的標(biāo)準(zhǔn)輸入輸出設(shè)備來實現(xiàn)動態(tài)網(wǎng)頁的生成,而 JSP是直接和服務(wù)器相關(guān)聯(lián)的。另外,更加復(fù)雜的請求模型可看作從被請求頁呼叫其他 JSP 頁或 Java Servlets。它以 JavaBeans 和 Enterprise JavaBeans(EJB)組件包含商務(wù)和數(shù) 據(jù)邏輯的模型為基礎(chǔ),提供大量標(biāo)簽和一個腳本平臺用來在 HTML 頁中顯示由 JavaBeans 產(chǎn)生或回送的內(nèi)容。表達(dá)邏輯通常和商務(wù)及數(shù)據(jù)邏輯混在一起,這使得當(dāng)程序員試圖改變一個應(yīng)用程序的外觀而不想破壞與之緊密結(jié)合的商務(wù)邏輯時,應(yīng)用程序的維護(hù)就變得十分艱難。 在 JSP 規(guī)范書中,并沒有明確要求 JSP 中的程序代碼部分 (稱為 Scriptlet)一定要用Java 來寫。 JSP 的特點 按照腳本語言是服務(wù)于某一個子系統(tǒng)的語言這種論述, JSP 應(yīng)當(dāng) 被看作是一種腳本語言。 ” 在此 , Gosling 的抱怨顯示出,他感到這個公司會從其他公司那里拿走技術(shù) ,用于他們自己的目的 .出人意料的是,形勢已經(jīng)完全不同 。由于Java Servlet 內(nèi)部是以線程方式提供服務(wù),不必對于每個請求都啟動一個進(jìn)程,并且利用多線程機制可以同時為多個請求服務(wù),因此 Java Servlet 效率非常高。 在某些項目中,更適宜選用 servlet,而 針對項目中的某些請求, 我們 可能 會在 MVC 構(gòu)架下組合使用這兩項技術(shù)。即使 是 那些對 JSP 一無所知的 HTML 工具,我們也可以使用,因為它們會忽略 JSP 標(biāo)簽( JSP tags)。 JSP 頁面最終會轉(zhuǎn)換成 servlet。 在 Sun 正式發(fā)布 JSP(Java Server Pages)之后,這種新的 Web 應(yīng)用開發(fā)技術(shù)很快引起了人們的關(guān)注。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 pany would take technology from other panies and suborn it for their own purposes. But guess what? T