【正文】
rly 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 pany39。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? The shoe is on the other foot here. The Java munity did not invent the idea of designing pages as 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 pany 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. 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 bee more like the SSJS, it also allows you carry the static state HTML 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. CHARACTERISTICS Is 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. 4 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 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 bine with a JavaBeans together, providing a kind of make contents and manifestation that simple way that logic separate. Separate the contents 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, to build up a from have the alike external appearance of the website that page constitute. JavaBeans pletes 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 the 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. Explain the dynamic state web page development tool of the type, such as ASP, PHP3 etc., because speed etc. reason, have already can39。 在 Sun 正式發(fā)布 JSP(Java Server Pages)之后,這種新的 Web 應(yīng)用開發(fā)技術(shù)很快引起了人們的關(guān)注。 JSP 頁(yè)面最終會(huì)轉(zhuǎn)換成 servlet。即使 是 那些對(duì) JSP 一無(wú)所知的 HTML 工具,我們也可以使用,因?yàn)樗鼈儠?huì)忽略 JSP 標(biāo)簽( JSP tags)。 在某些項(xiàng)目中,更適宜選用 servlet,而 針對(duì)項(xiàng)目中的某些請(qǐng)求, 我們 可能會(huì) 在 MVC 構(gòu)架下組合使用這兩項(xiàng)技術(shù)。由于Java Servlet 內(nèi)部是以線程方式提供服務(wù),不必對(duì)于每個(gè)請(qǐng)求都啟動(dòng)一個(gè)進(jìn)程,并且利用多線程機(jī)制可以同時(shí)為多個(gè)請(qǐng)求服務(wù),因此 Java Servlet 效率非常高。 ” 在此 , Gosling 的抱怨顯示出,他感到這個(gè)公司會(huì)從其他公司那里拿走技術(shù) ,用于他們自己的目的 .出人意料的是,形勢(shì)已經(jīng)完全不同 。 JSP 的特點(diǎn) 按照腳本語(yǔ)言是服務(wù)于某 一個(gè)子系統(tǒng)的語(yǔ)言這種論述, JSP 應(yīng)當(dāng)被看作是一種腳本語(yǔ)言。 在 JSP 規(guī)范書中,并沒(méi)有明確要求 JSP 中的程序代碼部分 (稱為 Scriptlet)一定要用Java 來(lái)寫。表達(dá)邏輯通常和商務(wù)及數(shù)據(jù)邏輯混在一起,這使得當(dāng)程序員試圖改變一個(gè)應(yīng)用程序的外觀而不想破壞與之緊密結(jié)合的商務(wù)邏 10 輯時(shí),應(yīng)用程序的維護(hù)就變得十分艱難。它以 JavaBeans 和 Enterprise JavaBeans(EJB)組件包含商務(wù)和數(shù)據(jù)邏輯的模型為基礎(chǔ),提供大量標(biāo)簽和一個(gè)腳本平臺(tái)用來(lái)在 HTML 頁(yè)中顯示由 JavaBeans 產(chǎn)生或回送的內(nèi)容。另外,更加復(fù)雜的請(qǐng)求模型可看作從被請(qǐng)求頁(yè)呼叫其他 JSP 頁(yè)或 Java Servlets。首 先,在速度上,傳統(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)的。其次, JSP 是專門為 Web 開發(fā)而設(shè)計(jì)的,其目的是為了建立基于 Web 的應(yīng)用程序,其中包含了一整套的規(guī)范和工具。這些代碼塊被 JSP 引擎組織到用戶看不到的 Java Servlet 中去,然后 Servlet 自動(dòng)把它們編譯成 Java 字節(jié)碼。非 Java 開發(fā)者可以通過(guò) JSP 的標(biāo)簽 (Tags)來(lái)使用高級(jí) Java 開發(fā)者創(chuàng)建的 JavaBeans。 HTML 和圖形設(shè)計(jì)師把它們的設(shè)計(jì)的實(shí)施工作交給了 Web 編寫者,使他們不得不加倍工作 —— 常常是手工編寫,因?yàn)闆](méi)有合適的工具可以把服務(wù)器端腳本與 HTML 內(nèi)容結(jié)合起來(lái)。按照 JSP規(guī)范書寫,和 Java 沒(méi)有任何關(guān)系的 Scriptlet 也是可以的,不過(guò),由于 JSP 的強(qiáng)大功能主要在于能和 JavaBeans、 Enterprise JavaBeans 共同運(yùn)轉(zhuǎn),所以即使是 Scriptlet 部分不使用Java,編譯成的執(zhí)行代碼也應(yīng)該是與 Java 相關(guān)的。 作為一種基于文本的、以顯示為中心的開發(fā)技術(shù), JSP 提供了 Java Servlet 的所有好處,并且, 當(dāng)與一個(gè) JavaBeans 類結(jié)合在一起時(shí), JSP 提供了一種使內(nèi)容和顯示邏輯分開的簡(jiǎn)單方式。 ColdFusion 多年前就已經(jīng)這樣做了。為了解決 Java Servlet 的這種缺點(diǎn), SUN 推出了 JSP。 JSP 的由來(lái) Su