【正文】
deal of label and a script terraces to use to e to show in the HTML page from the contents of JavaBeans creation or send a present in return. Because of the property that regards the module as the center of the JSP, it can drive Java and not the developer of Java uses equally. Not the developer of Java can pass the JSP label( Tags) to use the JavaBeans that the deluxe developer of Java establish. The developer of Java not only can establish and use the JavaBeans, but also can use the language of Java to e to control more accurately in the JSP page according to the expression logic of the first floor JavaBeans. 6 See now how JSP is handle claim of HTTP. In basic claim model, a claim directly was send to JSP page in. The code of JSP controls to carry on hour of the logic processing and module of JavaBeanses39。 本文將介紹 JSP 相關(guān)的知識,以及 JavaBean 的相關(guān)內(nèi)容,當然都是比較粗略的介紹其中的基本內(nèi)容,僅僅起到拋磚引玉的作用,如果讀者需要更詳細的信息,請參考相應的JSP 的書籍。問題不在于技術(shù)的能力,而是二者在便利性、生產(chǎn)率和可維護性上的不同。 Web 開發(fā)人員可以將經(jīng)理集中在表示層( presentation layer)上。使用 JSP 標識或者小腳本來生成頁面上的動態(tài)內(nèi)容 (內(nèi)容是根據(jù)請求來變化的 )。 許多年前, Marty 受到邀請 ,參加一個有關(guān)軟件技術(shù)的小型研討會 .坐 在 Marty 旁邊的人是 James Gosling Java 編程語言的發(fā)明者。甚至 ASP(來自于前述經(jīng)理所在公司的一項產(chǎn)品 )都在 JSP 出現(xiàn)之前推廣了這種方式。分開內(nèi)容和顯示邏輯的好處是,更新頁面外觀的人員不 必懂得 Java代碼,而更新 JavaBeans 類的人員也不必是設(shè)計網(wǎng)頁的行家里手,就可以用帶 JavaBeans類的 JSP 頁面來定 義 Web 模板,以建立一個由具有相似的外觀的頁面組成的網(wǎng)站。 JSP 的機制 要理解 JSP怎樣聯(lián)合以上各種所提到的技術(shù)的優(yōu)點,從而輕而易舉地實現(xiàn)各種效果,用戶必須首先了解 “組件為中心的網(wǎng)頁開發(fā) ”和 “頁面為中心的網(wǎng)頁開發(fā) ”的區(qū)別。簡而言之,隨著 Web 應用程序 的復雜性不斷提升,以頁面為中心的開發(fā)方式的局限性變得明顯起來。 Java 開發(fā)者不僅可以創(chuàng)建和使用 JavaBeans,還能在 JSP 頁中使用 Java 語言來更精密地控制基于底層 JavaBeans 的表達邏輯。這樣,當網(wǎng)站的訪問者請求一個 JSP 頁時,在它不知道的情況下,一個已經(jīng)生成的、預編譯過的 Servlet 實際上將完成所有的工作,非常隱蔽而又高效。使用JSP 技術(shù)可以很方便地將一大堆 JSP 頁面組合成為一個 Web 應用程序。 和傳統(tǒng)的 CGI 相比較, JSP 有相當?shù)膬?yōu)勢。 Beans 可以是 JavaBeans 或 EJB組件。 作為一種以組件為中心的開發(fā)平臺, JSP 出現(xiàn)了。在腳本環(huán)境中書寫的表達邏輯被鎖在頁面內(nèi),只有通過剪切和粘貼才能被重用。解釋式的動態(tài)網(wǎng)頁開發(fā)工具如 ASP、 PHP3 等由于速度等原因已經(jīng)滿足不了當前大型電子商務應用的需要了,傳統(tǒng)的開發(fā)技術(shù)都在向編譯執(zhí)行的 方式改變,如 ASP→ASP+ ;PHP3→PHP4 。JSP 把 Java 作為默認的腳本語言,然而,就像 ASP 可以使用其他語言 (如 JavaScript 和VBScript)一樣, JSP 規(guī)范也允許使用其他語言 。 他們會持續(xù)關(guān)注這項技術(shù) ,如果這項技術(shù)變得流行起來 ,他 們會遵循公司的 “ 接受并擴充 (embrace and extend)” 的策略 .此時 , Gosling 隨意地插話說 “ 你的意思其實就是不接受且不擴充 (disgrace and distend)。得益于 Java 的跨平臺的特性, Servlet 也是平臺無關(guān)的,實際上,只要符合 Java Servlet 規(guī)范, Servlet 是完全與平臺無關(guān)且是與 Web 服務器無關(guān)的。事實上, 幾乎所有 8 的項目都會同時用到這兩種技術(shù)。 能夠使用標準的網(wǎng)站開發(fā)工具。下面我們簡單的對它進行介紹。盡管 JSP 規(guī)范是由 Sun 公司制定的,但任何廠商都可以在自己的系統(tǒng)上實現(xiàn) JSP。t do any translation, if reader would like to, can call it as small service procedure. 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 e to born page of Web of dynamic 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 characteristic of the Java crossplatform, the Servlet is also a terrace irrelevant, actually, as long as match the norm of Java Servlet, the Servlet is plete 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 service by the line distance, need not start a progress 3 to the each claimses, and make use of the multithreading 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, 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 evilforeboding dream simply. 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 20person 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 highlevel manager from a very large software pany 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 ea