【正文】
he dynamic content. Now, this discussion is not to say that you should stop using servlets and use only JSP instead. By no means. Almost all projects will use both. For some requests in your project, you will use servlets. For others, you will use JSP. For still others, you will bine them with the MVC architecture . You want the appropriate tool for the job, and servlets, by themselves, do not plete your toolkit. SOURCE OF JSP The technique of JSP of the pany of Sun, making the page of Web develop the personnel can use the HTML perhaps marking of XML to design to turn the end page with format. Use the perhaps small script future life of marking of JSP bees the dynamic state on the page contents.( the contents 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 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 out of. 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, edit and translate of performance code also should is related with Java. 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 work of that time is still very young, no one knows to still have in addition to making all business, datas and the 大連交通大學(xué) 2021 屆本科生畢業(yè)設(shè)計(jì)(論文)外文翻譯 5 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 the one 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。與SSJS 和 ASP 相比, JSP 具有更好的可擴(kuò)展性,并且它不專屬于任何一家廠商或某一特定的 Web 服務(wù)器。按照 Sun的說法, JSP 能夠適應(yīng)市場(chǎng)上包括 Apache WebServer、 在內(nèi)的 85%的服務(wù)器產(chǎn)品。兩者都提供在 HTML 代碼中混合某種程序代碼、由語言引擎解釋執(zhí)行程序代碼的能力。然而,這種底層的等同性并不意味著 servlet 和 JSP 頁面對(duì)于所有的情況都等同適 用。 JSP 中可以使用常規(guī)的 HTML:沒有額外的反斜杠,沒有額外的雙引號(hào),也沒有暗含的 Java 語法。 Java 程序員可以致力于動(dòng)態(tài)代碼。 大連交通大學(xué) 2021 屆本科生畢業(yè)設(shè)計(jì)(論文)外文翻譯 8 此處的討論并不是說人們應(yīng)該放棄使用 servlet 而僅僅使用 JSP。 JSP 的由來 Sun 公司的 JSP 技術(shù),使 Web 頁面開發(fā)人員可以使用 HTML 或者 XML 標(biāo)識(shí)來設(shè)計(jì)和格式化最終頁面。許多 Web 服務(wù)器都支持 Servlet,即使不直接支持 Servlet 的 Web 服務(wù)器也可以通過附加的應(yīng)用服務(wù)器和模塊來支持 Servlet。為了解決 Java Servlet 的這種缺點(diǎn), SUN 推出了 JSP。 主席向該經(jīng)理詢問他的想法 .他 回答 說 ,雖然現(xiàn)在言之過早,但這看起來會(huì)是非常有前途的一項(xiàng)技術(shù)。 ColdFusion 多年前就已經(jīng)這樣做了。像 SSJS 一樣,它也允許你將靜態(tài) HTML 內(nèi)容與服務(wù)器端腳本混合起來生成動(dòng)態(tài)輸出。 作為一種基于文本的、以顯示為中心的開發(fā)技術(shù), JSP 提供了 Java Servlet 的所有好處,并且, 當(dāng)與一個(gè) JavaBeans 類結(jié)合在一起時(shí), JSP 提供了一種使內(nèi)容和顯示邏輯分開的簡(jiǎn)單方式。 一般來說,在實(shí)際的 JSP 引擎中, JSP 頁面在執(zhí)行時(shí)是編譯式,而不是解釋式的。按照 JSP規(guī)范書寫,和 Java 沒有任何關(guān)系的 Scriptlet 也是可以的,不過,由于 JSP 的強(qiáng)大功能主要在于能和 JavaBeans、 Enterprise JavaBeans 共同運(yùn)轉(zhuǎn),所以即使是 Scriptlet 部分不使用Java,編 譯成的執(zhí)行代碼也應(yīng)該是與 Java 相關(guān)的。然而,隨著時(shí)間的推移,人們認(rèn)識(shí)到這種方法不適于構(gòu)建大型的、可升級(jí)的 Web 應(yīng)用程序。 HTML 和圖形設(shè)計(jì)師把它們的設(shè)計(jì)的實(shí)施工作交給了 Web 編寫者,使他們不得不加倍工作 —— 常常是手工編寫,因?yàn)闆]有合適的工具可以把服務(wù)器端腳本與 HTML 內(nèi)容結(jié)合起來。這些技術(shù)使某領(lǐng)域內(nèi)的專家可以為本領(lǐng)域內(nèi)的垂直應(yīng)用編寫組件,而開發(fā)者可以直接拿來使用而不必掌握這一領(lǐng)域的專門技術(shù)。非 Java 開發(fā)者可以通過 JSP 的標(biāo)簽 (Tags)來使用高級(jí) Java 開發(fā)者創(chuàng)建的 JavaBeans。 JSP 代碼控制著進(jìn)行邏輯處理時(shí)與 JavaBeans 組件的交互,并在動(dòng)態(tài)生成的、混合了靜態(tài) HTML 代碼的 HTML 頁中顯示結(jié)果。這些代碼塊被 JSP 引擎組織到用戶看不到的 Java Servlet 中去,然后 Servlet 自動(dòng)把它們編譯成 Java 字節(jié)碼。由于是 JSP 引擎自動(dòng)生成并編譯 Servlet,不用程序員動(dòng)手編譯代碼,所以 JSP 能帶給你高效的性能和快速開發(fā)所需的靈活性。其次, JSP 是專門為 Web 開發(fā)而設(shè)計(jì)的,其目的是為了建立基于 Web 的應(yīng)用程序,其中包含了一整套的規(guī)范和工具。對(duì)于分析員和設(shè)計(jì)人員,建模過程( the modeling process)變得更簡(jiǎn)單而且可以創(chuàng)建一個(gè)有序而可控的設(shè)計(jì)。用對(duì)象的方式來思考問題相比于過程化的思考問題 方式有著很大的差別,而且設(shè)計(jì)一個(gè)對(duì)象比起設(shè)計(jì)一個(gè)過程來說是一個(gè)很大的挑戰(zhàn),特別是當(dāng)你要設(shè)計(jì)一個(gè)可復(fù)用的對(duì)象( reusable objects)的時(shí)候。 1 Fortunately, this has change significantly with the advent of thirdparty libraries and Standard C++ library. 頁 40 It is, in fact, difficult to design objects wellfor that matter, it’s hard to design anything well. But the int