【正文】
而且對于 CGI 來說,每一個訪問就需要新增加一個進程來處理,進程不斷地建立和銷毀對于作為 Web 服務器的計算機將是不小的負擔。 JSP 引擎實際上要把 JSP 標簽、 JSP 頁中的 Java 代碼甚至連同靜態(tài) HTML 內容都轉換為大塊的 Java 代碼。由于 JSP 的以組件為中心的性質,它可以被 Java 和非 Java 開發(fā)者同樣使用。其事實上,企業(yè)中可重用組件的應用早已經很成熟,沒有人愿意為它們的應用程序重寫那些邏輯。實際上,有一些 JSP 引擎就是采用的其他腳本語言,如 EMACScript、 WebL等,但實際上這幾種腳本語言也是構建在 Java 上面,編譯為 Servlet 來實現(xiàn)的。然而,作為一種腳本語言, JSP 又顯得過于強大了,在 JSP 中幾乎可以使用全部的 Java 類。 Java 團隊并 沒有發(fā)明這一思想 將頁面設計成由靜態(tài) HTML 和用特殊標簽標記的動態(tài)代碼混合組成 .。 但 Java Servlet也不是沒有缺點,和傳統(tǒng)的 CGI、 ISAPI、 NSAPI 方式相同, Java Servlet是利用輸出 HTML 語句來實現(xiàn)動態(tài)網頁的,如果用 Java Servlet 來開發(fā)整個網站,動態(tài)部分和靜態(tài)頁面的 整合過程會非常難以實現(xiàn)。我們總是希望用適當?shù)墓ぞ咄瓿上鄬墓ぷ鳎瑑H僅是 servlet 并不 一定能夠勝任所有工作 。 可以對開發(fā)團隊 進行劃分。因而,從根本上, JSP 頁面能夠執(zhí)行的任何任務都可以用 servlet 來完成。 JSP 為創(chuàng)建高度動態(tài)的 Web 應用提供了一個獨特的開發(fā)環(huán)境。t satisfy current the large electronic merce needs appliedly, traditional development techniques are all at to edit and translate the executive way change, such as the ASP → ASP+。s concern. JSP provided a special development environment for the Web application that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, on the market at inside of 85% server product. This chapter will introduce the related knowledge of JSP and Databases, and JavaBean related contents, is all certainly rougher introduction among them basic contents, say perhaps to is a Guide only, if the reader needs the more detailed information, pleasing the book of consult the homologous JSP. GENERALIZE The JSP(Java Server Pages) is from the pany of Sun Microsystems initiate, the many panies the participate to the build up the together of the a kind the of dynamic the state web the page technique standard, the it have the it in the construction the of the dynamic state the web page the strong but the do not the especially of the function. JSP and the technique of ASP of the Microsoft is very alike. Both all provide the ability that mixes with a certain procedure code and is explain by the language engine to carry out the procedure code in the code of HTML. Underneath we are simple of carry on the introduction to it. JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be acplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular puter platform in the Java programming language you could also do in assembly language. But it still matters which you choose. 2 JSP provides the following benefits over servlets alone: ? It is easier to write and maintain the HTML. Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax. ? You can use standard Website development tools. Even HTML tools that know nothing about JSP can be used because they simply ignore the JSP tags. ? You can divide up your development team. The Java programmers can work on the dynamic code. The Web developers can concentrate on the presentation layer. On large projects, this division is very important. Depending on the size of your team and the plexity of your project, you can enforce a weaker or stronger separation between the static HTML and the 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。與SSJS 和 ASP 相比, JSP 具有更好的可擴展性,并且它不專屬于