【正文】
ents 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 match with the JSP and then can plete, this name of Servlet es 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 don39。PHP3 → PHP4. In the JSP norm book, did not request the procedure in the JSP code part( be called the Scriptlet) and must 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 languages also are to set up on the Java, edit and translate for the Servlet to carry outof. 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 together, so even is the Scriptlet part not to use the Java, editand translate of performance code also should is related with Java.D. JSP mechanism To prehend the JSP how unite the technical advantage that above various speak of, e to carry out various result easily, the customer must understand 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 business, 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 up 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 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 one would like to rewrite those logics for their applied and sketch the designer handed over to the implement work of their design the Web plait theone who write, make they have to double work Usually is the handicraft plait to write, because have no fit tool and can carry the script and the HTML contents knot to the server to put together. Chien but speech, apply the plexity of the procedure along with the Web to promote continuously, the development method that take page as the center limits sex to bee to get up obviously. At the same time, the people always at look for the better method of build up the Web application procedure, the module spreads in customer39。盡管JSP 規(guī)范是由Sun公司制定的,但任何廠商都可以在自己的系統(tǒng)上實現(xiàn)JSP。本文將介紹JSP 相關的知識,以及JavaBean的相關內(nèi)容,當然都是比較粗略的介紹其中的基本內(nèi)容,或者說僅僅是一個Guide,如果讀者需要更詳細的信息,請參考相應的JSP 的書籍。下面我們簡單的對它進行介紹。問題不在于技術的能力,而是二者在便利性、生產(chǎn)率和可維護性上的不同。能夠使用標準的網(wǎng)站開發(fā)工具。Web開發(fā)人員可以將經(jīng)理集中在表示層(presentation layer)上。幾乎所有的項目都會同時用到這兩種技術。使用JSP標識或者小腳本來生成頁面上的動態(tài)內(nèi)容(內(nèi)容是根據(jù)請求來變化的)。得益于Java 的跨平臺的特性,Servlet也是平臺無關的,實際上,只要符合Java Servlet規(guī)范,Servlet是完全與平臺無關且是與Web 服務器無關的。許多年前,Marty受到邀請,參加一個有關軟件技術的小型(20個人)Marty旁邊的人是James GoslingJava編程語言的發(fā)明者。Java社團沒有發(fā)明這一思想將頁面設計成由靜態(tài)HTML 和用特殊標簽標記的動態(tài)代碼混合組成.。JSP 是建立在Java servlets模型之上的表達層技術,它使編寫HTML 變得更簡單。然而,作為一種腳本語言,JSP又顯得過于強大了,在JSP中幾乎可以使用全部的Java類。當然,也可以利用Java Servlet來控制網(wǎng)站的邏輯,通過Java Servlet調(diào)用JSP文件的方式來將網(wǎng)站的邏輯和內(nèi)容分離。實際上,有一些JSP引擎就是采用的其他腳本語言,如EMACScript、WebL 等,但實際上這幾種腳本語言也是構建在Java上面,編譯為Servlet來實現(xiàn)的。這種以頁面為中心的模型容易學習并且得到相當快速的發(fā)展。其實在企業(yè)中,可重用組件的應用早已經(jīng)很成熟,沒有人愿意為它們的應用程序重寫那些邏輯。JavaBeans和ActiveX被“快速應用程序開發(fā)”(RAD)工具發(fā)行商推廣給Java 和Windows應用程序開發(fā)者用來快速開發(fā)復雜的程序。由于JSP的以組件為中心的性質,它可以被Java和非Java開發(fā)者同樣使用。在基本請求模型中,一個請求直接被送到JSP 頁中。JSP引擎實際上要把JSP標簽、JSP頁中的Java代碼甚至連同靜態(tài)HTML內(nèi)容都轉換為大塊的Java代碼。JSP引擎只需在Servlet代碼最后被修改后編譯一次,然后這個編譯過的Servlet就可以被執(zhí)行了。而且對于CGI來說,每一個訪問就需要新增加一個進程來處理,進程不斷地建立和銷毀對于作為Web服務器的計算機將是不小的負擔