【正文】
ervlet, 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 pageof 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 , can also make use of the Java Servlet to control the logic of the website, adjustthrough the Java Servlet to use the way of the document of JSP to separate website of logicand 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。JSP為創(chuàng)建高度動態(tài)的Web應用提供了一個獨特的開發(fā)環(huán)境。因而,從根本上,JSP頁面能夠執(zhí)行的任何任務都可以用servler來完成??梢詫﹂_發(fā)團隊進行劃分。我們總是希望用適當的工具完成相對應的工作,僅僅是servlet并不能填滿您的工具箱。但Java Servlet也不是沒有缺點,和傳統(tǒng)的CGI、ISAPI、NSAPI 方式相同,JavaServlet是利用輸出HTML 語句來實現動態(tài)網頁的,如果用Java Servlet來開發(fā)整個網站,動態(tài)部分和靜態(tài)頁面的整合過程簡直就是一場惡夢。甚至ASP(來自于前述經理所在公司的一項產品)都在JSP 出現之前推廣了這種方式。分開內容和顯示邏輯的好處是,更新頁面外觀的人員不必懂得Java代碼,而更新JavaBeans類的人員也不必是設計網頁的行家里手,就可以用帶JavaBeans類的JSP 頁面來定義Web模板,以建立一個由具有相似的外觀的頁面組成的網站。D. JSP的機制要理解JSP怎樣聯合以上各種所提到的技術的優(yōu)點,來輕而易舉地實現各種效果,用戶必須首先了解“組件為中心的網頁開發(fā)”和“頁面為中心的網頁開發(fā)”的區(qū)別。簡而言之,隨著Web應用程序的復雜性不斷提升,以頁面為中心的開發(fā)方式的局限性變得明顯起來。Java開發(fā)者不僅可以創(chuàng)建和使用JavaBeans,還能在JSP頁中使用Java語言來更精密地控制基于底層JavaBeans的表達邏輯。這樣,當網站的訪問者請求一個JSP頁時,在它不知道的情況下,一個已經生成的、預編譯過的Servlet實際上將完成所有的工作,非常隱蔽而又高效。使用JSP技術可以很方便地將一大堆JSP頁面組合成為一個Web應用程序。和傳統(tǒng)的CGI相比較,JSP有相當的優(yōu)勢。Beans可以是JavaBeans或EJB組件。作為一種以組件為中心的開發(fā)平臺,JSP出現了。在腳本環(huán)境中書寫的表達邏輯被鎖在頁面內,只有通過剪切和粘貼才能被重用。解釋式的動態(tài)網頁開發(fā)工具如ASP、PHP3等由于速度等原因已經滿足不了當前大型電子商務應用的需要了,傳統(tǒng)的開發(fā)技術都在向編譯執(zhí)行的方式改變,如ASP→ASP+;PHP3→PHP4。JSP把Java作為默認的腳本語言,然而,就像ASP可以使用其他語言(如JavaScript和VBScript)一樣,JSP規(guī)范也允許使用其他語言。在討論過程中,研討會的主席提出了Jini的議題,他們會持續(xù)關注這項技術,如果這項技術變得流行起來,他們會遵循公司的“接受并擴充(embrace and extend)”, Gosling隨意地插話說“你的意思其實就是不接受且不擴充(disgrace and distend)。Servlet其實和傳統(tǒng)的CGI、ISAPI、NSAPI 等Web程序開發(fā)工具的作用是相同的,在使用Java Servlet以后,用戶不必再使用效率低下的CGI方式,也不必使用只能在某個固定Web 服務器平臺運行的API 方式來動態(tài)生成Web頁面。依據開發(fā)團隊的大小,及項目的復雜程度,可以對靜態(tài)HTML和動態(tài)內容進行弱分離(weaker separation)和強分離(stronger separation)。和單獨使用servler相比,JSP提供下述好處:JSP中HTML的編寫與維護更為簡單。JSP與Microsoft的ASP 技術非常相似。 hand over with each other, and the manifestation result in dynamic state bornly, mixing with the HTML page of the static state HTML code. The Beans can be JavaBeans or module of EJBs. Moreover, the more plicated claim model can see make from is request other JSP pages of the page call sign or Java Servlets. The engine of JSP wants to chase the code of Java that the label of JSP, code of Java in the JSP page even all converts into the big piece together with the static state HTML contents actually. These codes piece was organized the Java Servlet that customer can not see to go to by the engine of JSP, then the Servlet edits and translate them automatically byte code of Java.Thus, the visitant that is the website requests a JSP page, under the condition of it is not knowing, an already born, the Servlet actual full general that prepared to edit and translate pletes all works, very concealment but again and efficiently. The Servlet is to edit and translate of, so the code of JSP in the web page does not need when the every time requests that page is explain. The engine of JSP need to be edit and translate after Servlet the code end is modify only once, then this Servlet that editted and translate can be carry out. The in view of the fact JSP engine auto is born to edit and translate the Servlet also, need not procedure member begins to edit and translate the code, so the JSP can bring vivid sex that function and fast developments need that you are efficiently.Compared with the traditional CGI, the JSP has the equal advantage. First, on the speed, the traditional procedure of CGI needs to use the standard importation of the system to output the equipments to carry out the dynamic state web page born, but the JSP is direct is mutually the connection