![外文文獻(xiàn)翻譯-JSP發(fā)展歷史中英文_第1頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-5/14/87ff0b52-029e-4d2e-9f07-b6827f2d1f67/87ff0b52-029e-4d2e-9f07-b6827f2d1f671.gif)
![外文文獻(xiàn)翻譯-JSP發(fā)展歷史中英文_第2頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-5/14/87ff0b52-029e-4d2e-9f07-b6827f2d1f67/87ff0b52-029e-4d2e-9f07-b6827f2d1f672.gif)
![外文文獻(xiàn)翻譯-JSP發(fā)展歷史中英文_第3頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-5/14/87ff0b52-029e-4d2e-9f07-b6827f2d1f67/87ff0b52-029e-4d2e-9f07-b6827f2d1f673.gif)
![外文文獻(xiàn)翻譯-JSP發(fā)展歷史中英文_第4頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-5/14/87ff0b52-029e-4d2e-9f07-b6827f2d1f67/87ff0b52-029e-4d2e-9f07-b6827f2d1f674.gif)
![外文文獻(xiàn)翻譯-JSP發(fā)展歷史中英文_第5頁(yè)](http://file3.renrendoc.com/fileroot_temp3/2022-5/14/87ff0b52-029e-4d2e-9f07-b6827f2d1f67/87ff0b52-029e-4d2e-9f07-b6827f2d1f675.gif)
版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、精選優(yōu)質(zhì)文檔-傾情為你奉上專(zhuān)心-專(zhuān)注-專(zhuān)業(yè)JSP 的技術(shù)發(fā)展歷史作者: Kathy Sierra and Bert Bates來(lái)源: Servlet&JSPJava Server Pages(JSP)是一種基于 web 的腳本編程技術(shù),類(lèi)似于網(wǎng)景公司的服務(wù)器端 Java 腳本語(yǔ)言 server-side JavaScript(SSJS)和微軟的 Active Server Pages(ASP)。與 SSJS 和 ASP 相比,JSP 具有更好的可擴(kuò)展性,并且它不專(zhuān)屬于任何一家廠商或某一特定的 Web 服務(wù)器。盡 管 JSP 規(guī)范是由 Sun 公司制定的,但任何廠商都可以在自己的系統(tǒng)上實(shí)現(xiàn) JS
2、P。在 Sun 正式發(fā)布 JSP(Java Server Pages)之后,這種新的 Web 應(yīng)用開(kāi)發(fā)技術(shù)很快引起了人們 的關(guān)注。JSP 為創(chuàng)建高度動(dòng)態(tài)的 Web 應(yīng)用提供了一個(gè)獨(dú)特的開(kāi)發(fā)環(huán)境。按照 Sun 的說(shuō)法,JSP 能夠 適應(yīng)市場(chǎng)上包括 Apache WebServer、IIS4.0 在內(nèi)的 85%的服務(wù)器產(chǎn)品。本文將介紹 JSP 相關(guān)的知識(shí),以及 JavaBean 的相關(guān)內(nèi)容,當(dāng)然都是比較粗略的介紹其中的基 本內(nèi)容,僅僅起到拋磚引玉的作用,如果讀者需要更詳細(xì)的信息,請(qǐng)參考相應(yīng)的 JSP 的書(shū)籍。1.1 概述JSP(Java Server Pages)是由 Sun Microsyste
3、ms 公司倡導(dǎo)、許多公司參與一起建立的一種 動(dòng)態(tài)網(wǎng)頁(yè)技術(shù)標(biāo)準(zhǔn),其在動(dòng)態(tài)網(wǎng)頁(yè)的建設(shè)中有其強(qiáng)大而特別的功能。JSP 與 Microsoft 的 ASP 技 術(shù)非常相似。兩者都提供在 HTML 代碼中混合某種程序代碼、由語(yǔ)言引擎解釋執(zhí)行程序代碼的能力。 下面我們簡(jiǎn)單的對(duì)它進(jìn)行介紹。JSP 頁(yè)面最終會(huì)轉(zhuǎn)換成 servlet。因而,從根本上,JSP 頁(yè)面能夠執(zhí)行的任何任務(wù)都可以用 servlet 來(lái)完成。然而,這種底層的等同性并不意味著 servlet 和 JSP 頁(yè)面對(duì)于所有的情況都等 同適用。問(wèn)題不在于技術(shù)的能力,而是二者在便利性、生產(chǎn)率和可維護(hù)性上的不同。畢竟,在特 定平臺(tái)上能夠用 Java 編程
4、語(yǔ)言完成的事情,同樣可以用匯編語(yǔ)言來(lái)完成,但是選擇哪種語(yǔ)言依舊 十分重要。和單獨(dú)使用 servlet 相比,JSP 提供下述好處:1) JSP 中 HTML 的編寫(xiě)與維護(hù)更為簡(jiǎn)單。JSP 中可以使用常規(guī)的 HTML:沒(méi)有額外的反斜杠, 沒(méi)有額外的雙引號(hào),也沒(méi)有暗含的 Java 語(yǔ)法。2) 能夠使用標(biāo)準(zhǔn)的網(wǎng)站開(kāi)發(fā)工具。即使是那些對(duì) JSP 一無(wú)所知的 HTML 工具,我們也可以使 用,因?yàn)樗鼈儠?huì)忽略 JSP 標(biāo)簽(JSP tags)。3) 可以對(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)目
5、,這種劃分極為重要。依據(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)。此處的討論并不是說(shuō)人們應(yīng)該放棄使用 servlet 而僅僅使用 JSP。事實(shí)上,幾乎所有的項(xiàng)目 都會(huì)同時(shí)用到這兩種技術(shù)。在某些項(xiàng)目中,更適宜選用 servlet,而針對(duì)項(xiàng)目中的某些請(qǐng)求,我 們可能會(huì)在 MVC 構(gòu)架下組合使用這兩項(xiàng)技術(shù)。我們總是希望用適當(dāng)?shù)墓ぞ咄瓿上鄬?duì)應(yīng)的工作,僅 僅是 servlet 并不一定能夠勝任所有工作。11.2 JSP 的由來(lái)Sun 公司的 JSP 技術(shù),使 Web 頁(yè)面開(kāi)發(fā)人
6、員可以使用 HTML 或者 XML 標(biāo)識(shí)來(lái)設(shè)計(jì)和格式化最終 頁(yè)面。使用 JSP 標(biāo)識(shí)或者小腳本來(lái)生成頁(yè)面上的動(dòng)態(tài)內(nèi)容(內(nèi)容是根據(jù)請(qǐng)求來(lái)變化的)。Java Servlet 是 JSP 技術(shù)的基礎(chǔ),而且大型的 Web 應(yīng)用程序的開(kāi)發(fā)需要 Java Servlet 和 JSP 配合才能完成,Servlet 這個(gè)名稱(chēng)源于 Applet,現(xiàn)在國(guó)內(nèi)的翻譯方式很多,本書(shū)為了避免誤會(huì), 決定直接采用 Servlet 而不做任何翻譯,讀者如果愿意,可以稱(chēng)之為“小服務(wù)程序”。Servlet 其 實(shí)和傳統(tǒng)的 CGI、ISAPI、NSAPI 等 Web 程序開(kāi)發(fā)工具的作用是相似的,在使用 Java Servlet 以
7、后, 用戶(hù)不必再使用效率低下的 CGI 方式,也不必使用只能在某個(gè)固定 Web 服務(wù)器平臺(tái)運(yùn)行的 API 方 式來(lái)動(dòng)態(tài)生成 Web 頁(yè)面。許多 Web 服務(wù)器都支持 Servlet,即使不直接支持 Servlet 的 Web 服務(wù) 器也可以通過(guò)附加的應(yīng)用服務(wù)器和模塊來(lái)支持 Servlet。得益于 Java 的跨平臺(tái)的特性,Servlet 也是平臺(tái)無(wú)關(guān)的,實(shí)際上,只要符合 Java Servlet 規(guī)范,Servlet 是完全與平臺(tái)無(wú)關(guān)且是與 Web 服務(wù)器無(wú)關(guān)的。由于 Java Servlet 內(nèi)部是以線程方式提供服務(wù),不必對(duì)于每個(gè)請(qǐng)求都啟動(dòng)一個(gè)進(jìn) 程,并且利用多線程機(jī)制可以同時(shí)為多個(gè)請(qǐng)求服務(wù)
8、,因此 Java Servlet 效率非常高。但 Java Servlet 也不是沒(méi)有缺點(diǎn),和傳統(tǒng)的 CGI、ISAPI、NSAPI 方式相同,Java Servlet 是利用輸出 HTML 語(yǔ)句來(lái)實(shí)現(xiàn)動(dòng)態(tài)網(wǎng)頁(yè)的,如果用 Java Servlet 來(lái)開(kāi)發(fā)整個(gè)網(wǎng)站,動(dòng)態(tài)部分和靜 態(tài)頁(yè)面的整合過(guò)程會(huì)非常難以實(shí)現(xiàn)。為了解決 Java Servlet 的這種缺點(diǎn),SUN 推出了 JSP。許多年前,Marty 受到邀請(qǐng),參加一個(gè)有關(guān)軟件技術(shù)的小型研討會(huì).坐在 Marty 旁邊的人是 James Gosling- Java 編程語(yǔ)言的發(fā)明者。隔幾個(gè)位置,是來(lái)自華盛頓一家大型軟件公司的高級(jí) 經(jīng)理。在討論過(guò)程
9、中,研討會(huì)的主席提出了 Jini 的議題,這在當(dāng)時(shí)是一項(xiàng)新的 Java 技術(shù)。主席向 該經(jīng)理詢(xún)問(wèn)他的想法.他回答說(shuō),雖然現(xiàn)在言之過(guò)早,但這看起來(lái)會(huì)是非常有前途的一項(xiàng)技術(shù)。他 們會(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)。”在此, Gosling 的抱怨顯示出,他感到這個(gè)公司會(huì)從其他公司那里拿走技術(shù),用于他們自己的 目的.出人意料的是,形勢(shì)已經(jīng)完全不同。Java 團(tuán)隊(duì)并沒(méi)有發(fā)明這一思想-將頁(yè)面設(shè)計(jì)成由靜
10、 態(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)簽。JSP 是建立在 Java servlets 模型之上的表達(dá)層技術(shù),它使編寫(xiě) HTML 變得更簡(jiǎn)單。像 SSJS 一樣,它也允許你將靜態(tài) HTML 內(nèi)容與服務(wù)器端腳本混合起來(lái)生成動(dòng)態(tài)輸出。JSP 把 Java 作為默 認(rèn)的腳本語(yǔ)言,然而,就像 ASP 可以使用其他語(yǔ)言(如 JavaScript 和 VBScript)一樣,JSP
11、規(guī)范也 允許使用其他語(yǔ)言。1.3 JSP 的特點(diǎn)按照腳本語(yǔ)言是服務(wù)于某一個(gè)子系統(tǒng)的語(yǔ)言這種論述,JSP 應(yīng)當(dāng)被看作是一種腳本語(yǔ)言。然 而,作為一種腳本語(yǔ)言,JSP 又顯得過(guò)于強(qiáng)大了,在 JSP 中幾乎可以使用全部的 Java 類(lèi)。作為一種基于文本的、以顯示為中心的開(kāi)發(fā)技術(shù),JSP 提供了 Java Servlet 的所有好處,并2且,當(dāng)與一個(gè) JavaBeans 類(lèi)結(jié)合在一起時(shí),JSP 提供了一種使內(nèi)容和顯示邏輯分開(kāi)的簡(jiǎn)單方式。 分開(kāi)內(nèi)容和顯示邏輯的好處是,更新頁(yè)面外觀的人員不必懂得 Java 代碼,而更新 JavaBeans 類(lèi)的 人員也不必是設(shè)計(jì)網(wǎng)頁(yè)的行家里手,就可以用帶 JavaBean
12、s 類(lèi)的 JSP 頁(yè)面來(lái)定義 Web 模板,以建 立一個(gè)由具有相似的外觀的頁(yè)面組成的網(wǎng)站。JavaBeans 類(lèi)完成數(shù)據(jù)提供,這樣在模板中就沒(méi)有 Java 代碼,這意味著這些模板可以由一個(gè) HTML 編寫(xiě)人員來(lái)維護(hù)。當(dāng)然,也可以利用 Java Servlet 來(lái)控制網(wǎng)站的邏輯,通過(guò) Java Servlet 調(diào)用 JSP 文件的方式來(lái)將網(wǎng)站的邏輯和內(nèi)容分離。一般來(lái)說(shuō),在實(shí)際的 JSP 引擎中,JSP 頁(yè)面在執(zhí)行時(shí)是編譯式,而不是解釋式的。解釋式的 動(dòng)態(tài)網(wǎng)頁(yè)開(kāi)發(fā)工具如 ASP、PHP3 等由于速度等原因已經(jīng)滿(mǎn)足不了當(dāng)前大型電子商務(wù)應(yīng)用的需要了, 傳統(tǒng)的開(kāi)發(fā)技術(shù)都在向編譯執(zhí)行的方式改變,如 ASP
13、ASP+;PHP3PHP4。在 JSP 規(guī)范書(shū)中,并沒(méi)有明確要求 JSP 中的程序代碼部分(稱(chēng)為 Scriptlet)一定要用 Java 來(lái) 寫(xiě)。實(shí)際上,有一些 JSP 引擎就是采用的其他腳本語(yǔ)言,如 EMAC-Script、WebL 等,但實(shí)際上這 幾種腳本語(yǔ)言也是構(gòu)建在 Java 上面,編譯為 Servlet 來(lái)實(shí)現(xiàn)的。按照 JSP 規(guī)范書(shū)寫(xiě),和 Java 沒(méi) 有任何關(guān)系的 Scriptlet 也是可以的,不過(guò),由于 JSP 的強(qiáng)大功能主要在于能和JavaBeans、Enterprise JavaBeans 共同運(yùn)轉(zhuǎn),所以即使是 Scriptlet 部分不使用 Java,編譯成 的執(zhí)行代碼
14、也應(yīng)該是與 Java 相關(guān)的。1.4 JSP 的機(jī)制要理解 JSP 怎樣聯(lián)合以上各種所提到的技術(shù)的優(yōu)點(diǎn),從而輕而易舉地實(shí)現(xiàn)各種效果,用戶(hù)必 須首先了解“組件為中心的網(wǎng)頁(yè)開(kāi)發(fā)”和“頁(yè)面為中心的網(wǎng)頁(yè)開(kāi)發(fā)”的區(qū)別。SSJS 和 ASP 都是在幾年前推出的,那時(shí)網(wǎng)絡(luò)還很年輕,沒(méi)有人知道除了把所有的商務(wù)、數(shù)據(jù) 和表達(dá)邏輯統(tǒng)統(tǒng)堆進(jìn)原始網(wǎng)頁(yè)中之外還有什么更好的解決方法。這種以頁(yè)面為中心的模型容易學(xué) 習(xí)并且得到相當(dāng)快速的發(fā)展。然而,隨著時(shí)間的推移,人們認(rèn)識(shí)到這種方法不適于構(gòu)建大型的、 可升級(jí)的 Web 應(yīng)用程序。在腳本環(huán)境中書(shū)寫(xiě)的表達(dá)邏輯被鎖在頁(yè)面內(nèi),只有通過(guò)剪切和粘貼才能 被重用。表達(dá)邏輯通常和商務(wù)及數(shù)據(jù)邏
15、輯混在一起,這使得當(dāng)程序員試圖改變一個(gè)應(yīng)用程序的外 觀而不想破壞與之緊密結(jié)合的商務(wù)邏輯時(shí),應(yīng)用程序的維護(hù)就變得十分艱難。其事實(shí)上,企業(yè)中 可重用組件的應(yīng)用早已經(jīng)很成熟,沒(méi)有人愿意為它們的應(yīng)用程序重寫(xiě)那些邏輯。HTML 和圖形設(shè)計(jì) 師把它們的設(shè)計(jì)的實(shí)施工作交給了 Web 編寫(xiě)者,使他們不得不加倍工作 常常是手工編寫(xiě),因 為沒(méi)有合適的工具可以把服務(wù)器端腳本與 HTML 內(nèi)容結(jié)合起來(lái)。簡(jiǎn)而言之,隨著 Web 應(yīng)用程序的復(fù) 雜性不斷提升,以頁(yè)面為中心的開(kāi)發(fā)方式的局限性變得明顯起來(lái)。與此同時(shí),人們一直在尋找建立 Web 應(yīng)用程序的更好方法,組件在客戶(hù)機(jī)/服務(wù)器領(lǐng)域流行起 來(lái)。JavaBeans 和 Ac
16、tiveX 被“快速應(yīng)用程序開(kāi)發(fā)”(RAD)工具發(fā)行商推廣給 Java 和 Windows 應(yīng) 用程序開(kāi)發(fā)者用來(lái)快速開(kāi)發(fā)復(fù)雜的程序。這些技術(shù)使某領(lǐng)域內(nèi)的專(zhuān)家可以為本領(lǐng)域內(nèi)的垂直應(yīng)用 編寫(xiě)組件,而開(kāi)發(fā)者可以直接拿來(lái)使用而不必掌握這一領(lǐng)域的專(zhuān)門(mén)技術(shù)。作為一種以組件為中心的開(kāi)發(fā)平臺(tái),JSP 出現(xiàn)了。它以 JavaBeans 和 Enterprise JavaBeans(EJB)組件包含商務(wù)和數(shù)據(jù)邏輯的模型為基礎(chǔ),提供大量標(biāo)簽和一個(gè)腳本平臺(tái)用來(lái)在 HTML 頁(yè)中顯示由 JavaBeans 產(chǎn)生或回送的內(nèi)容。由于 JSP 的以組件為中心的性質(zhì),它可以被 Java 和非 Java 開(kāi)發(fā)者同樣使用。非 Ja
17、va 開(kāi)發(fā)者可以通過(guò) JSP 的標(biāo)簽(Tags)來(lái)使用高級(jí) Java 開(kāi)發(fā)者創(chuàng) 建的 JavaBeans。Java 開(kāi)發(fā)者不僅可以創(chuàng)建和使用 JavaBeans,還能在 JSP 頁(yè)中使用 Java 語(yǔ)言來(lái)3更精密地控制基于底層 JavaBeans 的表達(dá)邏輯。現(xiàn)在來(lái)看看 JSP 是如何處理 HTTP 請(qǐng)求的。在基本請(qǐng)求模型中,一個(gè)請(qǐng)求直接被送到 JSP 頁(yè)中。 JSP 代碼控制著進(jìn)行邏輯處理時(shí)與 JavaBeans 組件的交互,并在動(dòng)態(tài)生成的、混合了靜態(tài) HTML 代 碼的 HTML 頁(yè)中顯示結(jié)果。Beans 可以是 JavaBeans 或 EJB 組件。另外,更加復(fù)雜的請(qǐng)求模型可 看作從被請(qǐng)
18、求頁(yè)呼叫其他 JSP 頁(yè)或 Java Servlets。JSP 引擎實(shí)際上要把 JSP 標(biāo)簽、JSP 頁(yè)中的 Java 代碼甚至連同靜態(tài) HTML 內(nèi)容都轉(zhuǎn)換為大塊的 Java 代碼。這些代碼塊被 JSP 引擎組織到用戶(hù)看不到的 Java Servlet 中去,然后 Servlet 自動(dòng) 把它們編譯成 Java 字節(jié)碼。這樣,當(dāng)網(wǎng)站的訪問(wèn)者請(qǐng)求一個(gè) JSP 頁(yè)時(shí),在它不知道的情況下,一 個(gè)已經(jīng)生成的、預(yù)編譯過(guò)的 Servlet 實(shí)際上將完成所有的工作,非常隱蔽而又高效。因?yàn)?Servlet 是編譯過(guò)的,所以網(wǎng)頁(yè)中的 JSP 代碼不需要在每次請(qǐng)求該頁(yè)時(shí)被解釋一遍。JSP 引擎只需 在 Servl
19、et 代碼最后被修改后編譯一次,然后這個(gè)編譯過(guò)的 Servlet 就可以被執(zhí)行了。由于是 JSP 引擎自動(dòng)生成并編譯 Servlet,不用程序員動(dòng)手編譯代碼,所以 JSP 能帶給你高效的性能和快 速開(kāi)發(fā)所需的靈活性。和傳統(tǒng)的 CGI 相比較,JSP 有相當(dāng)?shù)膬?yōu)勢(shì)。首先,在速度上,傳統(tǒng)的 CGI 程序需要使用系統(tǒng) 的標(biāo)準(zhǔn)輸入輸出設(shè)備來(lái)實(shí)現(xiàn)動(dòng)態(tài)網(wǎng)頁(yè)的生成,而 JSP 是直接和服務(wù)器相關(guān)聯(lián)的。而且對(duì)于 CGI 來(lái) 說(shuō),每一個(gè)訪問(wèn)就需要新增加一個(gè)進(jìn)程來(lái)處理,進(jìn)程不斷地建立和銷(xiāo)毀對(duì)于作為 Web 服務(wù)器的計(jì) 算機(jī)將是不小的負(fù)擔(dān)。其次,JSP 是專(zhuān)門(mén)為 Web 開(kāi)發(fā)而設(shè)計(jì)的,其目的是為了建立基于 Web
20、的應(yīng) 用程序,其中包含了一整套的規(guī)范和工具。使用 JSP 技術(shù)可以很方便地將一大堆 JSP 頁(yè)面組合成 為一個(gè) Web 應(yīng)用程序。4THE TECHNIQUE DEVELOPMENT HISTORY OF JSP By:Kathy Sierra and Bert BatesS ource: Servlet&JSPT he Java Server Pages( JSP) is a kind of according to web of the script plait distance technique, similar carries the script language of Java
21、in the server of the Netscape company of server- side JavaScript( SSJS) and the Active Server Pages(ASP) of the Microsoft. JSP compares the SSJS and ASP to have better can expand sex, and it is no more exclusive than any factory or some one particular server of Web. Though the norm of JSP is to be d
22、raw up by the Sun company of, any factory can carry out the JSP on own system.The After Sun release the JSP( the Java Server Pages) formally, the this kind of new Web application development technique very quickly caused the peoples concern. JSP provided a special development environment for the Web
23、 application that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, IIS4.0 on the market at inside of 85% server product.This chapter will introduce the related knowledge of JSP and Databases, and JavaBean related contents, is all c
24、ertainly rougher introduction among them basic contents, say perhaps to is a Guide only, if the reader needs the more detailed information, pleasing the book of consult the homologous JSP.1.1 GENERALIZEThe JSP(Java Server Pages) is from the company of Sun Microsystems initiate, the many companies th
25、e participate to the build up the together of the a kind the of dynamic the state web the page technique standard, the it have the it in the construction the of the dynamic state the web page the strong but the do not the especially of the function. JSP and the technique of ASP of the Microsoft is v
26、ery alike. Both all provide the ability that mixes with a certain procedure code and is explain by the language engine to carry out the procedure code in the code of HTML. Underneath we are simple of carry on the introduction to it.JSP pages are translated into servlets. So, fundamentally, any task
27、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
28、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:1)It is easier to write and maintain the HTML. Your static co
29、de is ordinary HTML: no extra5backslashes, no double quotes, and no lurking Java syntax.2) 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.3) You can divide up your development team. The Java programmers
30、 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 dyna
31、mic 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 ar
32、chitecture . You want the appropriate tool for the job, and servlets, by themselves, do not complete your toolkit.1.2 SOURCE OF JSPThe technique of JSP of the company 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 form
33、at. Use the perhaps small script future life of marking of JSP becomes 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 mat
34、ch with with the JSP and then can complete, this name of Servlet comes 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 dont do any translation, if reader would like to, can call it as small service pr
35、ocedure. The Servlet is similar to traditional CGI, ISAPI, NSAPI etc. Web procedure development the function of the tool in fact, at use the Java Servlet hereafter, the customer need not use again the lowly method of CGI of efficiency, also need not use only the ability come to born page of Web of d
36、ynamic state in the method of API that a certain fixed Web server terrace circulate. Many servers of Web all support the Servlet, even not support the Servlet server of Web directly and can also pass the additional applied server and the mold pieces to support the Servlet. Receive benefit in the cha
37、racteristic of the Java cross-platform, the Servlet is also a terrace irrelevant, actually, as long as match the norm of Java Servlet, the Servlet is complete to have nothing to do with terrace and is to have nothing to do with server of Web. Because the Java Servlet is internal to provide the servi
38、ce by the line distance, need not start a progress to the each claimses, and make use of the multi-threading mechanism can at the same time for several claim service, therefore the efficiency of Java Servlet is very high.But the Java Servlet also is not to has no weakness, similar to traditional CGI
39、, ISAPI, the NSAPI method, the Java Servlet is to make use of to output the HTML language sentence to carry out the dynamic state web page of, if develop the whole website with the Java Servlet, the integration process of the dynamic state part and the static state page is an evil-foreboding dream s
40、imply. For solving this kind of weakness of the Java Servlet, the SUN released the JSP.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 lan
41、guage. Sitting several seats away was a high-level manager from a very large6software 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 mana
42、ger 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 companys usual embrace and extend strategy. At this point, Gosling lightheartedly interjected You me
43、an 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
44、a mixture of static HTML and dynamic code marked with special tags. For example, Cold Fusion 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
45、only adopted the general idea, it even used many of the same special tags as ASP did.The JSP is an establishment at the model of Java servlets on of the expression layer technique, it makes the plait write the HTML to become more simple.Be like the SSJS, it also allows you carry the static state HTM
46、L contents and servers the script mix to put together the born dynamic state exportation. JSP the script language that the Java is the tacit approval, however, be like the ASP and can use other languages( such as JavaScript and VBScript), the norm of JSP also allows to use other languages.1.3JSP CHA
47、RACTERISTICSIs a service according to the script language in some one language of the statures system this kind of discuss, the JSP should be see make is a kind of script language. However, be a kind of script language, the JSP seemed to be too strong again, almost can use all Javas in the JSP.Be a
48、kind of according to text originally of, take manifestation as the central development technique, the JSP provided all advantages of the Java Servlet, and, when combine with a JavaBeans together, providing a kind of make contents and manifestation that simple way that logic separate. Separate the co
49、ntents and advantage of logical manifestations is, the personnel who renews the page external appearance need not know the code of Java, and renew the JavaBeans personnel also need not be design the web page of expert in hand, can use to take the page of JavaBeans JSP to define the template of Web,
50、to build up a from have the alike external appearance of the website that page constitute. JavaBeans completes the data to provide, having no code of Java in the template thus, this means that these templates can be written the personnel by a HTML plait to support. Certainly, can also make use of th
51、e Java Servlet to control the logic of the website, adjust through the Java Servlet to use the way of the document of JSP to separate website of logic and contents.Generally speaking, in actual engine of JSP, the page of JSP is the edit and translate type while carry out, not explain the type of. Ex
52、plain the dynamic state web page development tool of the type, such as ASP, PHP3 etc., because speed etc. reason, have already cant satisfy current the large electronic commerce needs appliedly, traditional development techniques are all at to edit and translate the executive way change, such as the
53、 ASP ASP+;PHP3 PHP4.In the JSP norm book, did not request the procedure in the JSP code part( be called the Scriptlet) and7must write with the Java definitely. Actually, have some engines of JSP are adoptive other script languages such as the EMAC- Script, etc., but actually this a few script langua
54、ges also are to set up on the Java, edit and translate for the Servlet to carry out of. Write according to the norm of JSP, have no Scriptlet of relation with Java also is can of, however, mainly lie in the ability and JavaBeans, the Enterprise JavaBeanses because of the JSP strong function to work
55、together, so even is the Scriptlet part not to use the Java, edit and translate of performance code also should is related with Java.1.4JSP MECHANISMTo comprehend the JSP how unite the technical advantage that above various speak of, come to carry out various result easily, the customer must underst
56、and the differentiation of the module develops for the web page of the center and the page develops for the web page of the center first.The SSJS and ASP are all in several year ago to release, the network of that time is still very young, no one knows to still have in addition to making all busines
57、s, datas and the expression logic enter the original web page entirely heap what better solve the method. This kind of model that take page as the center studies and gets the very fast development easily. However, along with change of time, the people know that this kind of method is unwell in set u
58、p large, the Web that can upgrade applies the procedure. The expression logic write in the script environment was lock in the page, only passing to shear to slice and glue to stick then can drive heavy use. Express the logic to usually mix together with business and the data logics, when this makes
59、be the procedure member to try to change an external appearance that applies the procedure but do not want to break with its llied business logic, apply the procedure of maintenance be like to walk the similar difficulty on the eggshell. In fact in the business enterprise, heavy use the application of the module already through very mature, no o
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 人教版數(shù)學(xué)八年級(jí)上冊(cè)《實(shí)驗(yàn)與探究三角形中邊與角之間的不等關(guān)系》聽(tīng)評(píng)課記錄
- 魯教版歷史六年級(jí)上冊(cè)第5課《夏、商、西周的興亡》聽(tīng)課評(píng)課記錄
- 魯人版道德與法治九年級(jí)下冊(cè)13.1《綠水青山就是金山銀山》聽(tīng)課評(píng)課記錄1
- 部審人教版八年級(jí)數(shù)學(xué)下冊(cè)聽(tīng)評(píng)課記錄18.2.1 第1課時(shí)《矩形的性質(zhì)》
- 七年級(jí)上冊(cè)道德與法治第十課綻放生命之花聽(tīng)課評(píng)課記錄(2課時(shí))
- 星球版地理八年級(jí)下冊(cè)《第二節(jié) 生態(tài)環(huán)境保護(hù)與資源開(kāi)發(fā)》聽(tīng)課評(píng)課記錄1
- 人教版歷史八年級(jí)上冊(cè)第22課《抗日戰(zhàn)爭(zhēng)的勝利》聽(tīng)課評(píng)課記錄
- 小學(xué)五年級(jí)聽(tīng)評(píng)課記錄
- 魯教版數(shù)學(xué)七年級(jí)上冊(cè)1.1《認(rèn)識(shí)三角形》聽(tīng)評(píng)課記錄5
- 蘇科版數(shù)學(xué)七年級(jí)下冊(cè)聽(tīng)評(píng)課記錄7.3圖形的平移1
- 四年級(jí)計(jì)算題大全(列豎式計(jì)算,可打印)
- 科技計(jì)劃項(xiàng)目申報(bào)培訓(xùn)
- 591食堂不合格食品處置制度
- 產(chǎn)業(yè)鏈鏈長(zhǎng)分工表
- 國(guó)際金融課件(完整版)
- 導(dǎo)向標(biāo)識(shí)系統(tǒng)設(shè)計(jì)(一)課件
- 220t鍋爐課程設(shè)計(jì) 李學(xué)玉
- 全英文劇本 《劇院魅影》
- 北京城的中軸線PPT通用課件
- 黑布林繪本 Dad-for-Sale 出售爸爸課件
- 京東方頂崗實(shí)習(xí)報(bào)告1
評(píng)論
0/150
提交評(píng)論