【正文】
Servlet 和 Jsp 技術(shù)概要 軟件工程 081 婁文 520813130116 2 An Overview of Servlet and JSP Technology Abstract: Servlet program running in the serverside, dynamically generated Web page with the traditional CGI and many other similar pared to CGI technology, Java Servlet with a more efficient, easier to use, more powerful and has better portability, more savings to invest . Key words: JSP Technology, Servlet, HTTP server A Servlet39。t know what to display until you read the data that the user submits. Just remember that the user submits two kinds of data: explicit (., HTML form data) and implicit (., HTTP request headers). Either kind of input can be used to build the output page. In particular, it is quite mon to build a userspecific page based on a cookie value. 2. The Web page is derived from data that changes frequently. If the page changes for every request, then you certainly need to build the response at request time. If it changes only periodically, however, you could do it two ways: you could periodically build a new Web page on the server (independently of client requests), or you could wait and only build the page when the user requests it. The right approach depends on the situation, but sometimes it is more convenient to do the latter: wait for the user request. For example, a weather report or news headlines site might build the pages dynamically, perhaps returning a previously built page if that page is still up to date. 3. The Web page uses information from corporate databases or other serverside sources. If the information is in a database, you need serverside processing even if the client is using dynamic Web content such as an applet. Imagine using an applet by itself for a search engine site: Downloading 50 terabyte applet, please wait! Obviously, that is silly。 see so industry support for servlets is being even more pervasive. B/S ( Browser/Server ) structure browser and server structure. It is along with the technology of Inter spring up , it is for the structure of improvement or a kind of change of the structure of C/S. Under this kind of structure, user working interface is to realize through WWW browser, lose the logic of general affairs very much in front( Browser) realization, but the major logic of general affairs in server end( Server) realization, form the threelayer claimed 3tier structure. So, have simplified customer end puter load greatly , have alleviated system to defend workload and the cost with upgrading , have reduced the overall cost of user ( TCO ). With present technology see , local area work the work application that establishes the structure of B/S , and under the pattern of Inter/Intra, database application is easy to hold relatively , cost also is lower. It is that oneness goes to the development of position , can realize different people, never same place, with difference receive the way of entering ( for example LAN, WAN, Inter/Intra etc.) visit and operate mon database。t know how to use them, what good are they? Servlet and JSP technology is supported by servers from Apache, Oracle, IBM, Sybase, BEA, Macromedia, Caucho, Sun/iPla, New Atlanta, ATG, Fujitsu, Lutris, Silverstream, the World Wide Web Consortium (W3C), and many others. Several lowcost plugins add support to Microsoft IIS and Zeus as well. They run on Windows, Unix/Linux, MacOS, VMS, and IBM mainframe operating systems. They are the single most popular application of the Java programming language. They are arguably the most popular choice for developing medium to large Web applications. They are used by the airline industry (most United Airlines and Delta Airlines Web sites), emerce (), online banking (First USA Bank, Banco Popular de Puerto Rico), Web search engines/portals (), large financial sites (American Century Investments), and hundreds of other sites that you visit every day. Of course, popularity alone is no proof of good technology. Numerous counterexamples abound. But our point is that you are not experimenting with a new Servlet 和 Jsp 技術(shù)概要 軟件工程 081 婁文 520813130116 9 and unproven technology when you work with serverside Java. Servlet 和 Jsp 技術(shù)概要 軟件工程 081 婁文 520813130116 10 英文翻譯 Servlet 和 Jsp 技術(shù)概要 摘要: Servlet 程序在服務(wù)器端運(yùn)行,動態(tài)地生成 Web頁面與傳統(tǒng)的 CGI和許多其他類似 CGI 的技術(shù)相比, Java Servlet 具有更高的效率,更容易使用,功能更強(qiáng)大,具有更好的可移植性,更節(jié)省投資。 最終用戶一般在頁面的 HTML 表單中輸入這些數(shù)據(jù)。兩種數(shù)據(jù)都很重要。實際的數(shù)據(jù)可能存儲在關(guān)系型數(shù)據(jù)庫中。因此,我們需要 Web中間層從 HTTP 流中提取輸入數(shù)據(jù),與應(yīng)用程序會話,并將結(jié)果嵌入到文檔中。 ( 5) 發(fā)送隱式的 HTTP 響應(yīng)數(shù)據(jù)。 HTTP 響應(yīng)數(shù)據(jù)的發(fā)送過程涉及告知瀏覽器或其他客戶程序所返回文檔的類型(如 HTML),設(shè)置 cookie 和緩存參數(shù),以及其他類似的 任務(wù)。 例如,搜索引擎生成的頁面,以及在線商店的訂單確認(rèn)頁面,都要針對特定的用戶請求而產(chǎn)生。基于 cookie 值針對具體用戶構(gòu)建頁面的情況尤其普遍。具體應(yīng)該采用哪種方式要根據(jù)具體情況而定,但后一種方式常常更為Servlet 和 Jsp 技術(shù)概要 軟件工程 081 婁文 520813130116 12 方便,因為它只需簡單地等待用戶的請求。想象以下,如果一個搜索引擎網(wǎng)站完全使用 applet,那么用戶將會看到: “ 正在下載 50TB 的 applet,請等待! ” 。 理論上講, servelt 并非只用于處理 HTTP 請求的 Web 服務(wù)器或應(yīng)用服務(wù)器,它同樣可以用于其他類型的服務(wù)器。 效率 應(yīng)用傳統(tǒng)的 CGI,針對每個 HTTP 請求都用啟動一個新的進(jìn)程。同樣的情況,如果使用servlet 則啟動 N 個 線程,單僅僅載入 servlet 類的單一副本。然而, servelt 會一直停留在內(nèi)存中(即使請求處理完畢),因而可以直接存儲客戶請求之間的任意復(fù)雜數(shù)據(jù)。 Servlet 能夠直接于 Web 服務(wù)器對話,而常規(guī)的 CGI 程序做不到這一點(diǎn),至少在不使用服務(wù)器專有 API 的情況下是這樣。 可移植性 Servelt 使用 Java 編程語言,并且遵循標(biāo)準(zhǔn)的 API。為 Macromedia JRun 編寫的servlet,可以不經(jīng)過任何修改地在 Apache Tomcat, Microsoft Inter Information Server, IBM WebSphere 。 通過 B/S( Browser/Serve