【正文】
JSP引擎只需在Servlet代碼最后被修改后編譯一次,然后這個(gè)編譯過的Servlet就可以被執(zhí)行了。JavaBeans和ActiveX被“快速應(yīng)用程序開發(fā)”(RAD)工具發(fā)行商推廣給Java 和Windows應(yīng)用程序開發(fā)者用來快速開發(fā)復(fù)雜的程序。當(dāng)然,也可以利用Java Servlet來控制網(wǎng)站的邏輯,通過Java Servlet調(diào)用JSP文件的方式來將網(wǎng)站的邏輯和內(nèi)容分離。許多年前,Marty受到邀請,參加一個(gè)有關(guān)軟件技術(shù)的小型(20個(gè)人)Marty旁邊的人是James GoslingJava編程語言的發(fā)明者。Web開發(fā)人員可以將經(jīng)理集中在表示層(presentation layer)上。本文將介紹JSP 相關(guān)的知識,以及JavaBean的相關(guān)內(nèi)容,當(dāng)然都是比較粗略的介紹其中的基本內(nèi)容,或者說僅僅是一個(gè)Guide,如果讀者需要更詳細(xì)的信息,請參考相應(yīng)的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 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 early 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。JSP 頁面最終會轉(zhuǎn)換成servler。針對項(xiàng)目中的某些請求,您可能會在MVC構(gòu)架下組合使用這兩項(xiàng)技術(shù)。ColdFusion多年前就已經(jīng)這樣做了。按照J(rèn)SP規(guī)范書寫,和Java沒有任何關(guān)系的Scriptlet也是可以的,不過,由于JSP的強(qiáng)大功能主要在于能和JavaBeans、Enterprise JavaBeans一起工作,所以即使是Scriptlet部分不使用Java,編譯成的執(zhí)行代碼也應(yīng)該是與Java相關(guān)的。非Java開發(fā)者可以通過JSP 的標(biāo)簽(Tags)來使用高級Java開發(fā)者創(chuàng)建的JavaBeans。其次,JSP是專門為Web開發(fā)而設(shè)計(jì)的,其目的是為了建立基于Web的應(yīng)用程序,包含了一整套的規(guī)范和工具。另外,更加復(fù)雜的請求模型可看作從被請求頁呼叫其他JSP頁或JavaServlets。表達(dá)邏輯通常和商務(wù)及數(shù)據(jù)邏輯混在一起,這使得當(dāng)程序員試圖改變一個(gè)應(yīng)用程序的外觀而不想破壞與之緊密結(jié)合的商務(wù)邏輯時(shí),應(yīng)用程序的維護(hù)就像在蛋殼上走路一樣困難。C. JSP 的特點(diǎn)按照腳本語言是服務(wù)于某一個(gè)子系統(tǒng)的語言這種論述,JSP應(yīng)當(dāng)被看作是一種腳本語言。許多Web 服務(wù)器都支持Servlet,即使不直接支持Servlet的Web 服務(wù)器也可以通過附加的應(yīng)用服務(wù)器和模塊來支持Servlet。JSP中可以使用常規(guī)的HTML:沒有額外的反斜杠,沒有額外的雙引號,也沒有暗含的Java語法。JSP比SSJS和ASP具有更好的可擴(kuò)展性,并且它不專屬于任何一家廠商或某一特定的Web服務(wù)器。 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 bu