【正文】
ava 字節(jié)碼。 JSP 代碼控 制著進(jìn)行邏輯處理時與 JavaBeans 組件的交互,并在動態(tài)生成的、混合了靜態(tài) HTML 代碼的 HTML 頁中顯示結(jié)果。非 Java 開發(fā)者可以通過 JSP 的標(biāo)簽 (Tags)來使用高級 Java 開發(fā)者創(chuàng)建的 JavaBeans。這些技術(shù)使某領(lǐng)域內(nèi)的專家可以為本領(lǐng)域內(nèi)的垂直應(yīng)用編寫組件,而開發(fā)者可以直接拿來使用而不必掌握這一領(lǐng)域的專門技術(shù)。 HTML 和圖形設(shè)計師把它們的設(shè)計的實施工作交給了 Web 編寫者,使他們不得不加倍工作 —— 常常是手工編寫,因為沒有合適的工具可以把服務(wù)器端腳本與 HTML 內(nèi)容結(jié)合起來。然而,隨著時間的推移,人們認(rèn)識到這種方法不適于構(gòu)建大型的、可升級的 Web 應(yīng)用程序。按照 JSP規(guī)范書寫,和 Java 沒有任何關(guān)系的 Scriptlet 也是可以的,不過,由于 JSP 的強(qiáng)大功能主要在于能和 JavaBeans、 Enterprise JavaBeans 共同運轉(zhuǎn),所以即使是 Scriptlet 部分不使用Java,編譯成的執(zhí)行 代碼也應(yīng)該是與 Java 相關(guān)的。 一般來說,在實際的 JSP 引擎中, JSP 頁面在執(zhí)行時是編譯式,而不是解釋式的。 作為一種基于文本的、以顯示為中心的開發(fā)技術(shù), JSP 提供了 Java Servlet 的所有好處,并且, 當(dāng)與一個 JavaBeans 類結(jié)合在一起時, JSP 提供了一種使內(nèi)容和顯示邏輯分開的簡單方式。像 SSJS 一樣,它也允許你將靜態(tài) HTML 內(nèi)容與服務(wù)器端腳本混合起來生成動態(tài)輸出。 ColdFusion 多年前就已經(jīng)這樣做了。 主席向該經(jīng)理詢問他的想法 .他 回答 說 ,雖然現(xiàn)在言之過早,但這看起來會是非常有前途的一項技術(shù)。為了解 決 Java Servlet 的這種缺點, SUN 推出了 JSP。許多 Web 服務(wù)器都支持 Servlet,即使不直接支持 Servlet 的 Web 服務(wù)器也可以通過附加的應(yīng)用服務(wù)器和模塊來支持 Servlet。 JSP 的由來 Sun 公司的 JSP 技術(shù),使 Web 頁面開發(fā)人員可以使用 HTML 或者 XML 標(biāo)識來設(shè)計和格式化最終頁面。 此處的討論并不是說人們應(yīng)該放棄使用 servlet 而僅僅使用 JSP。 Java 程序員可以致 力于動態(tài)代碼。 JSP 中可以使用常規(guī)的 HTML:沒有額外的反斜杠,沒有額外的雙引號,也沒有暗含的 Java 語法。然而,這種底層的等同性并不意味著 servlet 和 JSP 頁面對于所有的情況都等同適用。兩者都提供在 HTML 代碼中混合某種程序代碼、由語言引擎解釋執(zhí)行程序代碼的能力。按照 Sun的說法, JSP 能夠適應(yīng)市場上包括 Apache WebServer、 在內(nèi)的 85%的服務(wù)器產(chǎn)品。與SSJS 和 ASP 相比, JSP 具有更好的可擴(kuò)展性,并且它不專屬于任何一家廠商或某一特定的 Web 服務(wù)器。t satisfy current the large electronic merce needs appliedly, traditional development techniques are all at to edit and translate the executive way change, such as the ASP → ASP+。 1 THE TECHNIQUE DEVELOPMENT HISTORY OF JSP By:Kathy Sierra and Bert Bates The Java Server Pages( JSP) is a kind of according to web of the script plait distance technique, similar carries the script language of Java in the server of the Netscape pany of server side JavaScript( SSJS) and the Active Server Pages(ASP) of the Microsoft. JSP pares 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 draw up by the Sun pany 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 people39。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. However, be a kind of script language, the JSP seemed to be too strong again, almost can 4 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