版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、<p><b> 附錄A </b></p><p> JSP Technology Conspectus And Specialties</p><p> The JSP (Java Server mix) technology is used by the Sun microsystem issued by the company to develo
2、p dynamic Web application technology. With its easy, cross-platform, in many dynamic Web application programming languages, in a short span of a few years, has formed a complete set of standards, and widely used in elect
3、ronic commerce, etc. In China, the JSP now also got more extensive attention, get a good development, more and more dynamic website to JSP technology. The related technologies of JS</p><p> The JSP a simple
4、 technology can quickly and with the method of generating Web pages. Use the JSP technology Web page can be easily display dynamic content. The JSP technology are designed to make the construction based on Web applicatio
5、ns easier and efficient, and these applications and various Web server, application server, the browser and development tools work together.</p><p> The JSP technology isn't the only dynamic web technol
6、ogy, also not the first one, in the JSP technology existed before the emergence of several excellent dynamic web technology, such as CGI, ASP, etc. With the introduction of these technologies under dynamic web technology
7、, the development and the JSP. Technical</p><p> JSP the development background and development history</p><p> In web brief history, from a world wide web that most of the network information
8、 static on stock transactions evolution to acquisition of an operation and infrastructure. In a variety of applications, may be used for based on Web client, look no restrictions.</p><p> Based on the brows
9、er client applications than traditional based on client/server applications has several advantages. These benefits include almost no limit client access and extremely simplified application deployment and management (to
10、update an application, management personnel only need to change the program on a server, not thousands of installation in client applications). So, the software industry is rapidly to build on the client browser multi-la
11、yer application.</p><p> The rapid growth of exquisite based Web application requirements development of technical improvements. Static HTML to show relatively static content is right choice, The new challe
12、nge is to create the interaction based on Web applications, in these procedures, the content of a Web page is based on the user's request or the state of the system, and are not predefined characters.</p><
13、p> For the problem of an early solution is to use a CGI - BIN interface. Developers write to interface with the relevant procedures and separate based on Web applications, the latter through the Web server to invoke
14、the former. This plan has serious problem -- each new extensible CGI requirements in a new process on the server. If multiple concurrent users access to this procedure, these processes will use the Web server of all avai
15、lable resources, and the performance of the system will be reduced </p><p> Some Web server providers have to provide for their server by plugins "and" the API to simplify the Web application deve
16、lopment. These solutions are associated with certain Web server, cannot solve the span multiple suppliers solutions. For example, Microsoft's Active Server mix (ASP) technology in the Web page to create dynamic conte
17、nt more easily, but also can work in Microsoft on Personal Web Server and IIS.</p><p> There are other solutions, but cannot make an ordinary page designers can easily master. For example, such as the Servl
18、et Java technologies can use Java language interaction application server code easier. Developers to write such Servlet to receive signals from the Web browser to generate an HTTP request, a dynamic response (may be inqu
19、ires the database to finish the request), then send contain HTML or XML documents to the response of the browser.</p><p> ? note: one is based on a Java Servlet Java technical operation in the server progra
20、m (with different, the latter operating in the Applet browser end). In this book the Servlet chapter 4.</p><p> Using this method, the entire page must have made in Java Servlet. If developers or Web manage
21、rs want to adjust page, you'll have to edit and recompile the Servlet Java, even in logic has been able to run. Using this method, the dynamic content with the application of the page still need to develop skills.<
22、;/p><p> Obviously, what is needed is a industry to create dynamic content within the scope of the pages of the solution. This program will solve the current scheme are limited. As follows:</p><p>
23、; ? can on any Web server or applications.</p><p> ? will application page displays and separation.</p><p> ? can rapidly developing and testing.</p><p> ? simplify the interact
24、ive development based on Web application process.</p><p> The JSP technology is designed to meet such requirements. The JSP specification is a Web server, application server, trading system and develop exte
25、nsive cooperation between the tool suppliers. From this standard to develop the existing integration and balance of Java programming environment (for example, Java Servlet and JavaBeans) support techniques and tools. The
26、 result is a kind of new and developing method based on Web applications, using component-based application logic page designers wit</p><p> Overall Semantics of a JSP Page</p><p> A JSP page
27、implementation class defines a _jspService() method mapping from the request to the response object. Some details of this transformation are specific to the scripting language used (see Chapter JSP.9, “Scripting”). Most
28、details are not language specific and are described in this chapter.</p><p> The content of a JSP page is devoted largely to describing the data that is written into the output stream of the response. (The
29、JSP container usually sends this data back to the client.) The description is based on a JspWriter object that is exposed through the implicit object out (see Section JSP.1.8.3, “Implicit Objects”). Its value varies:<
30、/p><p> Initially, out is a new JspWriter object. This object may be different from the stream object returned from response.getWriter(), and may be considered to be interposed on the latter in order to implem
31、ent buffering (see Section JSP.1.10.1, “The page Directive”). This is the initial out object. JSP page authors are prohibited from writing directly to either the PrintWriter or OutputStream associated with the ServletRes
32、ponse.</p><p> The JSP container should not invoke response.getWriter() until the time when the first portion of the content is to be sent to the client. This enables a number of uses of JSP, including usin
33、g JSP as a language to “glue” actions that deliver binary content, or reliably forwarding to a servlet, or change dynamically the content type of the response before generating content. See Chapter JSP.4, “Internationali
34、zation Issues”.</p><p> Within the body of some actions, out may be temporarily re-assigned to a different (nested) instance of a JspWriter object. Whether this is the case depends on the details of the act
35、ion’s semantics. Typically the content of these temporary streams is appended to the stream previously referred to by out, and out is subsequently re-assigned to refer to the previous (nesting) stream. Such nested stream
36、s are always buffered, and require explicit flushing to a nesting stream or their contents will be</p><p> If the initial out JspWriter object is buffered, then depending upon the value of the autoFlush att
37、ribute of the page directive, the content of that buffer will either be automatically flushed out to the ServletResponse output stream to obviate overflow, or an exception shall be thrown to signal buffer overflow. If th
38、e initial out JspWriter is unbuffered, then content written to it will be passed directly through to the ServletResponse output stream.</p><p> A JSP page can also describe what should happen when some spec
39、ific events occur. In JSP 2.1, the only events that can be described are the initialization and the destruction of the page. These events are described using “well-known method names” in declaration elements..</p>
40、<p> JavaScript is used for the first kind is browser, the dynamic general purpose of client scripting language. Netscape first proposed in 1995, but its JavaScript LiveScript called. Then quickly Netscape LiveScr
41、ipt renamed JavaScript, Java developers with them from the same issued a statement. A statement Java and JavaScript will complement each other, but they are different, so the technology of the many dismissed the misunder
42、standing of the two technologies.</p><p> JavaScript to create user interface control provides a scripting language. In fact, in the browser into the JavaScript code logic. It can support such effect: when
43、the cursor on the Web page of a mobile user input validation or transform image.</p><p> Microsoft also write out their JavaScript version and the JScript called. Microsoft and Netscape support JavaScript a
44、nd JScript around a core characteristics and European Manufacturers is.md by (ECMA) standards organization, the control standard of scripting language. ECMA its scripting language ECMAScript named.</p><p>
45、Servlets and JSPs often include fragments of information that are common to an organization, such as logos, copyrights, trademarks, or navigation bars. The web application uses the include mechanisms to import the inform
46、ation wherever it is needed, since it is easier to change content in one place then to maintain it in every piece of code where it is used. Some of this information is static and either never or rarely changes, such as a
47、n organization's logo. In other cases, the information is mo</p><p> You want to include a resource that does not change very much (such as a page fragment that represents a header or footer) in a JSP.
48、Use the include directive in the including JSP page, and give the included JSP segment a .jspf extension.</p><p> You want to include content in a JSP each time it receives a request, rather than when the J
49、SP is converted to a servlet. Use the jsp:include standard action.</p><p> You want to include a file dynamically in a JSP, based on a value derived from a configuration file. Use the jsp:include standard a
50、ction. Provide the value in an external properties file or as a configuration parameter in the deployment descriptor.</p><p> You want to include a fragment of an XML file inside of a JSP document, or inclu
51、de a JSP page in XML syntax. Use the jsp:include standard action for the includes that you want to occur with each request of the JSP. Use the jsp:directive.include element if the include action should occur during the t
52、ranslation phase.</p><p> You want to include a JSP segment from outside the including file's context. Use the c:import</p><p> The operation principle and the advantages of JSP tags</p
53、><p> In this section of the operating principle of simple introduction JSP and strengths.</p><p> For the first time in a JSP documents requested by the engine, JSP Servlet is transformed into a
54、 document JSP. This engine is itself a Servlet. The operating process of the JSP shown below:</p><p> (1) the JSP engine put the JSP files converting a Java source files (Servlet), if you find the files hav
55、e any grammar mistake JSP, conversion process will interrupt, and to the server and client output error messages.</p><p> (2) if converted, with the engine JSP javac Java source file compiler into a corresp
56、onding scale-up files.</p><p> (3) to create a the Servlet (JSP page), the transformation of the Servlet jspInit () method was executed, jspInit () method in the life cycle of Servlet executed only once.<
57、;/p><p> (4) jspService () method invocation to the client requests. For each request, JSP engine to create a new thread for processing the request. If you have multiple clients and request the JSP files, JSP
58、engine will create multiple threads. Each client requests a thread. To execute multi-thread can greatly reduce the requirement of system resources, improving the concurrency value and response time. But also should notic
59、e the multi-thread programming, due to the limited Servlet always in response to</p><p> (5) if the file has been modified. The JSP, server will be set according to the document to decide whether to recompi
60、le, if need to recompile, will replace the Servlet compile the memory and continue the process.</p><p> (6) although the JSP efficiency is high, but at first when the need to convert and compile and some sl
61、ight delay. In addition, if at any time due to reasons of system resources, JSP engine will in some way of uncertain Servlet will remove from memory. When this happens jspDestroy () method was first call.</p><
62、p> (7) and then Servlet examples were marked with "add" garbage collection. But in jspInit () some initialization work, if establish connection with database, or to establish a network connection, from a co
63、nfiguration file take some parameters, such as, in jspDestory () release of the corresponding resources.</p><p> Based on a Java language has many other techniques JSP page dynamic characteristics, technica
64、l have embodied in the following aspects:</p><p> One simplicity and effectiveness</p><p> The JSP dynamic web pages with the compilation of the static HTML pages of writing is very similar. J
65、ust in the original HTML page add JSP tags, or some of the proprietary scripting (this is not necessary). So, a familiar with HTML page write design personnel may be easily performed JSP page development. And the develop
66、ers can not only, and write script by JSP tags used exclusively others have written parts to realize dynamic pages. So, an unfamiliar with the web developers scripting language, c</p><p> Tow the independen
67、ce of the program</p><p> The JSP are part of the family of the API Java, it has the general characteristics of the cross-platform Java program. In other words, is to have the procedure, namely the independ
68、ence of the platform, 6 Write bided anywhere! .</p><p> Three procedures compatibility</p><p> The dynamic content can various JSP form, so it can show for all kinds of customers, namely from
69、using HTML/DHTML browser to use various handheld wireless equipment WML (for example, mobile phones and pdas), personal digital equipment to use XML applications, all can use B2B JSP dynamic pages.</p><p>
70、Four program reusability</p><p> In the JSP page can not directly, but embedded scripting dynamic interaction will be cited as a component part. So, once such a component to write, it can be repeated severa
71、l procedures, the program of the reusability. Now, a lot of standard JavaBeans library is a good example.</p><p><b> 附錄B</b></p><p> JSP技術(shù)簡介及特點</p><p> JSP(Java Serve
72、r Pages)技術(shù)是由Sun公司發(fā)布的用于開發(fā)動態(tài)Web應(yīng)用的一項技術(shù)。它以其簡單易學、跨平臺的特性,在眾多動態(tài)Web應(yīng)用程序設(shè)計語言中異軍突起,在短短幾年中已經(jīng)形成了一套完整的規(guī)范,并廣泛地應(yīng)用于電子商務(wù)等各個領(lǐng)域中。在國內(nèi),JSP現(xiàn)在也得到了比較廣泛的重視,得到了很好的發(fā)展,越來越多的動態(tài)網(wǎng)站開始采用JSP技術(shù)。下面就對JSP及其相關(guān)技術(shù)進行簡單的介紹。JSP技術(shù)可以以一種簡捷而快速的方法生成Web頁面。使用JSP技術(shù)的Web頁面
73、可以很容易地顯示動態(tài)內(nèi)容。JSP技術(shù)的設(shè)計目的是使得構(gòu)造基于Web的應(yīng)用程序更加容易和快捷,而這些應(yīng)用程序能夠與各種Web服務(wù)器、應(yīng)用服務(wù)器、瀏覽器和開發(fā)工具共同工作。</p><p> JSP技術(shù)不是惟一的動態(tài)網(wǎng)頁技術(shù),也不是第一個,在JSP技術(shù)出現(xiàn)之前就已經(jīng)存在幾種優(yōu)秀的動態(tài)網(wǎng)頁技術(shù),如CGI、ASP等。下面結(jié)合這些技術(shù)的介紹,講述動態(tài)網(wǎng)頁技術(shù)的發(fā)展和JSP技術(shù)的誕生。</p><p&g
74、t; JSP的開發(fā)背景及發(fā)展歷史</p><p> 在萬維網(wǎng)短暫的歷史中,萬維網(wǎng)已經(jīng)從一個大部分顯示靜態(tài)信息的網(wǎng)絡(luò)演化到對股票進行交易和進行購書操作的一個基礎(chǔ)設(shè)施。在各種各樣的應(yīng)用程序中,對于可能使用的基于Web的客戶端,看上去沒有任何限制。</p><p> 基于瀏覽器客戶端的應(yīng)用程序比傳統(tǒng)的基于客戶機/服務(wù)器的應(yīng)用程序有幾個好處。這些好處包括幾乎沒有限制的客戶端訪問和極其簡化的應(yīng)
75、用程序部署和管理(要更新一個應(yīng)用程序,管理人員只需要更改一個基于服務(wù)器的程序,而不是成千上萬的安裝在客戶端的應(yīng)用程序)。這樣,軟件工業(yè)正迅速地向建造基于瀏覽器客戶端的多層次應(yīng)用程序邁進。</p><p> 這些快速增長的精巧的基于Web的應(yīng)用程序要求開發(fā)技術(shù)上的改進。靜態(tài)HTML對于顯示相對靜態(tài)的內(nèi)容是不錯的選擇;新的挑戰(zhàn)在于創(chuàng)建交互的基于Web的應(yīng)用程序,在這些程序中,頁面的內(nèi)容是基于用戶的請求或者系統(tǒng)的狀態(tài)
76、,而不是預先定義的文字。</p><p> 對于這個問題的一個早期解決方案是使用CGI-BIN接口。開發(fā)人員編寫與接口相關(guān)的單獨的程序,以及基于Web的應(yīng)用程序,后者通過Web服務(wù)器來調(diào)用前者。這個方案有著嚴重的擴展性問題——每個新的CGI要求在服務(wù)器上新增一個進程。如果多個用戶并發(fā)地訪問該程序,這些進程將消耗該Web服務(wù)器所有的可用資源,并且系統(tǒng)性能會降低到極其低下的地步。</p><p&
77、gt; 某些Web服務(wù)器供應(yīng)商已經(jīng)嘗試通過為他們的服務(wù)器提供“插件”和API來簡化Web應(yīng)用程序的開發(fā)。這些解決方案是與特定的Web服務(wù)器相關(guān)的,不能解決跨多個供應(yīng)商的解決方案的問題。例如,微軟的Active Server Pages(ASP)技術(shù)使得在Web頁面上創(chuàng)建動態(tài)內(nèi)容更加容易,但也只能工作在微軟的IIS和Personal Web Server上。</p><p> 還存在其他的解決方案,但都不能使一
78、個普通的頁面設(shè)計者能夠輕易地掌握。例如,像Java Servlet這樣的技術(shù)就可以使得用Java語言編寫交互的應(yīng)用程序的服務(wù)器端的代碼變得容易。開發(fā)人員能夠編寫出這樣的Servlet,以接收來自Web瀏覽器的HTTP請求,動態(tài)地生成響應(yīng)(可能要查詢數(shù)據(jù)庫來完成這項請求),然后發(fā)送包含HTML或XML文檔的響應(yīng)到瀏覽器。</p><p> ?注意:一個Java Servlet就是一個基于Java技術(shù)的運行在服務(wù)器
79、端的程序(與Applet不同,后者運行在瀏覽器端)。Servlet會在本書第4章介紹。</p><p> 采用這種方法,整個網(wǎng)頁必須都在Java Servlet中制作。如果開發(fā)人員或者Web管理人員想要調(diào)整頁面顯示,就不得不編輯并重新編譯該Java Servlet,即使在邏輯上已經(jīng)能夠運行了。采用這種方法,生成帶有動態(tài)內(nèi)容的頁面仍然需要應(yīng)用程序的開發(fā)技巧。</p><p> 很顯然,目
80、前所需要的是一個業(yè)界范圍內(nèi)的創(chuàng)建動態(tài)內(nèi)容頁面的解決方案。這個方案將解決當前方案所受到的限制。如下:</p><p> ?能夠在任何Web或應(yīng)用程序服務(wù)器上運行。</p><p> ?將應(yīng)用程序邏輯和頁面顯示分離。</p><p> ?能夠快速地開發(fā)和測試。</p><p> ?簡化開發(fā)基于Web的交互式應(yīng)用程序的過程。<
81、/p><p> JSP技術(shù)就是被設(shè)計用來滿足這樣的要求的。JSP規(guī)范是Web服務(wù)器、應(yīng)用服務(wù)器、交易系統(tǒng)以及開發(fā)工具供應(yīng)商間廣泛合作的結(jié)果。Sun開發(fā)出這個規(guī)范來整合和平衡已經(jīng)存在的對Java編程環(huán)境(例如,Java Servlet和JavaBeans)進行支持的技術(shù)和工具。其結(jié)果是產(chǎn)生了一種新的、開發(fā)基于Web應(yīng)用程序的方法,給予使用基于組件應(yīng)用邏輯的頁面設(shè)計者以強大的功能。</p><p&g
82、t;<b> JSP頁整體語義</b></p><p> JSP頁實施類定義一個_ jspService() 方法映射反應(yīng)對象的請求。這些變革細節(jié)是具體用于腳本語言(參見Chapter JSP.9, “Scripting”)。多數(shù)細節(jié)不是具體語言,這些細節(jié)在這個章節(jié)里描述。</p><p> JSP頁的內(nèi)容主要致力于描述被寫入反應(yīng)的輸出流的數(shù)據(jù)(JSP容器通常傳
83、送返回給客戶的數(shù)據(jù)。)描述是根據(jù)JspWriter對象它通過隱含對象暴露。(參見JSP.1.8.3, “Implicit Objects”)。</p><p><b> 值的變化:</b></p><p> ?首先, 定義一個JspWriter 對象,這個對象不同于response.getWriter()返回對象。</p><p> 并
84、且為了實施中間轉(zhuǎn)換,可以認為是插入到buffering。這是最初外在對象。JSP 頁作者對于PrintWriter 或OutputStream 相關(guān)的ServletResponse被禁止寫直接寫入。</p><p> ?JSP容器不響應(yīng)response.getWriter()直到第一部份內(nèi)容送到客戶。JSP對“glue”動作是一種語言,它是二進制?;蛴趕ervlet相關(guān), 或在引起內(nèi)容之前改變反應(yīng)類型內(nèi)容。參
85、照JSP.4,“Internationalization Issues”. </p><p> ?在一些動作主體中,輸出不同于JspWriter對象實例的再分配,這取決于動作的細節(jié)。典型臨時數(shù)據(jù)流添加到先前的輸出流, 隨后輸出數(shù)據(jù)流再分配到先前數(shù)據(jù)流(嵌套)。Nested streams總被緩沖,并且明確要求緩沖嵌套數(shù)據(jù)流或被擯除的內(nèi)容。</p><p> ?如果out JspWr
86、iter 對象數(shù)據(jù)緩沖區(qū)滿, 則取決于autoFlush屬性值,緩沖內(nèi)容自動輸入到ServletResponse output stream ,消除溢出;或拋出緩沖溢出的信號。如果JspWriter不溢出, 寫入的內(nèi)容將被直接送入ServletResponse輸出流。</p><p> JSP頁也能描述一些應(yīng)該發(fā)生的具體事件。在JSP 2.1, 可被描述的唯一事件是初始化和頁的損壞。在聲明元素“well-kno
87、wn methodnames”中描述。(參見JSP.11.1.1.1, “Protocol Seen by theJSP Page Author”).</p><p> JavaScript是用于瀏覽器的第一種具有通用目的、動態(tài)的客戶端腳本語言。Netscape于1995年首先提出了JavaScript,但當時將其稱為LiveScript。后來Netscape迅速地將LiveScript改名為JavaScrip
88、t,Java的開發(fā)商Sun與他們在同一年發(fā)表了一項聲明。聲明中指出Java和JavaScript將互相補充,但它們是截然不同的技術(shù),這樣才打消了很多人對這兩項技術(shù)的錯誤理解。</p><p> JavaScript為創(chuàng)建用戶界面控件提供了一種腳本語言。事實上,JavaScript在瀏覽器中插入了代碼邏輯。它可以支持這樣的效果:當光標在Web頁的某個位置移動時驗證用戶輸入或者變換圖像。</p>&l
89、t;p> Microsoft也編寫出了自己的JavaScript版本并將其稱為JScript。Microsoft和Netscape都支持一種圍繞JavaScript和JScript的核心特性并由(European Computer Manufacturers Association,ECMA)標準組織控制的腳本語言標準。ECMA將其腳本語言命名為ECMAScript。</p><p> servlet和
90、JSP經(jīng)常包括一些組織中常見的信息,如logo、版本、商標或?qū)Ш綏l。Web應(yīng)用程序使用導入機制在任何所需的位置導入這些信息,因為這樣可以很容易地在一個地方改變內(nèi)容,然后維持在所有使用它的代碼中。有些信息是靜態(tài)的,永遠不會或很少會改變,如組織的logo。在其他情況下,信息是動態(tài)的,經(jīng)常在不可預見的時候改變,如必須針對每個用戶的文本歡迎語。在這兩種情況下,你可能都希望保證servlet或JSP可以獨立于所導入的內(nèi)容進行開發(fā),servlet或
91、JSP的實現(xiàn)在必要時正確地更新其導入的內(nèi)容。</p><p> 希望在JSP中導入不經(jīng)常改變的資源。在導入JSP頁面中使用include指令,并給予被導入的JSP代碼段.jsp擴展名。</p><p> 希望在JSP每次接收請求時,而不是在JSP轉(zhuǎn)換為servlet時導入內(nèi)容。使用jsp:include標準動作。</p><p> 希望在JSP中根據(jù)從配置文件
92、取得的值,動態(tài)地導入文件。使用jsp:include標準動作。在外部特性文件中提供它的值,或作為部署描述文件中的配置參數(shù)來提供。</p><p> 希望在JSP文檔中導入一段XML文件,或?qū)隭ML語法的JSP頁面。要在每次請求時進行導入,使用jsp:include標準動作。如果要在翻譯階段進行導入,使用jsp:directive。include元素。JSP的運行原理與優(yōu)點</p><p&g
93、t; 在本節(jié)中簡單介紹JSP的運行原理與優(yōu)點。</p><p> 在一個JSP文件第一次被請求時,JSP引擎把該JSP文件轉(zhuǎn)換成為一個Servlet。而這個引擎本身也是一個Servlet。JSP的運行過程如下所示:</p><p> ?。?)JSP引擎先把該JSP文件轉(zhuǎn)換成一個Java源文件(Servlet),在轉(zhuǎn)換時如果發(fā)現(xiàn)JSP文件有任何語法錯誤,轉(zhuǎn)換過程將中斷,并向服務(wù)端和客戶端
94、輸出出錯信息。</p><p> ?。?)如果轉(zhuǎn)換成功,JSP引擎用javac把該Java源文件編譯成相應(yīng)的class文件。</p><p> ?。?)創(chuàng)建一個該Servlet(JSP頁面的轉(zhuǎn)換結(jié)果)的實例,該Servlet的jspInit()方法被執(zhí)行,jspInit()方法在Servlet的生命周期中只被執(zhí)行一次。</p><p> ?。?)jspService
95、()方法被調(diào)用來處理客戶端的請求。對每一個請求,JSP引擎創(chuàng)建一個新的線程來處理該請求。如果有多個客戶端同時請求該JSP文件,則JSP引擎會創(chuàng)建多個線程。每個客戶端請求對應(yīng)一個線程。以多線程方式執(zhí)行可以大大降低對系統(tǒng)的資源需求,提高系統(tǒng)的并發(fā)量及響應(yīng)時間。但不過也應(yīng)該注意多線程的編程限制,由于該Servlet始終駐于內(nèi)存,所以響應(yīng)是非??斓?。</p><p> ?。?)如果.jsp文件被修改了,服務(wù)器將根據(jù)設(shè)置決
96、定是否對該文件重新編譯,如果需要重新編譯,則將編譯結(jié)果取代內(nèi)存中的Servlet,并繼續(xù)上述處理過程。</p><p> (6)雖然JSP效率很高,但在第一次調(diào)用時由于需要轉(zhuǎn)換和編譯而有一些輕微的延 遲。此外,在任何時候如果由于系統(tǒng)資源不足的原因,JSP引擎將以某種不確定的方式將Servlet從內(nèi)存中移去。當這種情況發(fā)生時jspDestroy()方法首先被調(diào)用。</p><p> ?。?/p>
97、7)然后Servlet實例便被標記加入“垃圾收集”處理??稍趈spInit()中進行一些初始化工作,如建立與數(shù)據(jù)庫的連接,或建立網(wǎng)絡(luò)連接,從配置文件中取一些參數(shù)等,在jspDestory()中釋放相應(yīng)的資源。</p><p> 基于Java語言的JSP技術(shù)具有很多其他動態(tài)網(wǎng)頁技術(shù)所沒有的特點,具體表現(xiàn)在如下方面:</p><p> 1.簡便性和有效性 </p><p
98、> JSP動態(tài)網(wǎng)頁的編寫與一般的靜態(tài)HTML的網(wǎng)頁編寫是十分相似的。只是在原來的HTML網(wǎng)頁中加入一些JSP專有的標簽,或是一些腳本程序(此項不是必需的)。這樣,一個熟悉HTML網(wǎng)頁編寫的設(shè)計人員可以很容易進行JSP網(wǎng)頁的開發(fā)。而且開發(fā)人員完全可以不自己編寫腳本程序,而只是通過JSP獨有的標簽使用別人已寫好的部件來實現(xiàn)動態(tài)網(wǎng)頁的編寫。這樣,一個不熟悉腳本語言的網(wǎng)頁開發(fā)者,完全可以利用JSP做出漂亮的動態(tài)網(wǎng)頁。而這在其他的動態(tài)網(wǎng)頁
99、開發(fā)中是不可實現(xiàn)的。</p><p><b> 2.程序的獨立性</b></p><p> JSP是Java API家族的一部分,它擁有一般的Java程序的跨平臺的特性。換句話說,就是擁有程序的對平臺的獨立性,即Write once,Run anywhere!。</p><p><b> 3.程序的兼容性 </b>&
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 畢業(yè)論文外文翻譯-jsp技術(shù)簡介及特點
- jsp技術(shù)簡介及特點文獻翻譯
- JSP技術(shù)簡介及特點文獻翻譯.doc
- 外文翻譯---jsp簡介
- 外文翻譯---jsp簡介
- 外文翻譯---servlet和jsp技術(shù)簡介
- 外文文獻翻譯---servlet和jsp技術(shù)簡介
- jsp 技術(shù)外文翻譯
- jsp技術(shù)外文翻譯
- jsp 外文翻譯--jsp及其web技術(shù)
- jsp技術(shù)概述外文翻譯
- 外文翻譯---jsp技術(shù)與主流java+ee開源框架(ssh)技術(shù)簡介
- 計算機專業(yè)畢業(yè)外文翻譯--jsp簡介
- jsp外文翻譯--jsp技術(shù)概述與應(yīng)用框架
- jsp技術(shù)網(wǎng)站設(shè)計外文翻譯
- 外文翻譯--jsp及其web技術(shù)
- 外文翻譯--jsp及其web技術(shù)
- asp技術(shù)簡介外文翻譯
- 外文翻譯---jsp動態(tài)網(wǎng)站技術(shù)
- jsp外文翻譯
評論
0/150
提交評論