版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、畢業(yè)設(shè)計(jì)說(shuō)明書英文文獻(xiàn)及中文翻譯班 級(jí): 學(xué)號(hào): 姓 名: 學(xué) 院: 專 業(yè): 指導(dǎo)教師: 年 月JSP Technology Conspectus And SpecialtiesThe JSP (Java Server mix) technology is used by the Sun microsystem issued by the company to develop dynamic Web application technology. With its easy, cross-platform, in many dynamic Web application programmin
2、g languages, in a short span of a few years, has formed a complete set of standards, and widely used in electronic 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 JSP are brie
3、fly introduced.The JSP a simple 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 applications easier and efficient, and these applications a
4、nd various Web server, application server, the browser and development tools work together.The JSP technology isn't the only dynamic web technology, 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
5、 the introduction of these technologies under dynamic web technology, the development and the JSP. TechnicalJSP the development background and development historyIn web brief history, from a world wide web that most of the network information static on stock transactions evolution to acquisition of
6、an operation and infrastructure. In a variety of applications, may be used for based on Web client, look no restrictions.Based on the browser client applications than traditional based on client/server applications has several advantages. These benefits include almost no limit client access and extr
7、emely simplified application deployment and management (to 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-layer application.The r
8、apid growth of exquisite based Web application requirements development of technical improvements. Static HTML to show relatively static content is right choice, The new challenge is to create the interaction based on Web applications, in these procedures, the content of a Web page is based on the u
9、ser's request or the state of the system, and are not predefined characters.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 the for
10、mer. 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 available resources, and the performance of the system will be reduced to extremely low.Some
11、 Web server providers have to provide for their server by plugins "and" the API to simplify the Web application development. These solutions are associated with certain Web server, cannot solve the span multiple suppliers solutions. For example, Microsoft's Active Server mix (ASP) tech
12、nology in the Web page to create dynamic content more easily, but also can work in Microsoft on Personal Web Server and IIS.There are other solutions, but cannot make an ordinary page designers can easily master. For example, such as the Servlet Java technologies can use Java language interaction ap
13、plication 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 inquires the database to finish the request), then send contain HTML or XML documents to the response of the browser. note: one is based on a
14、 Java Servlet Java technical operation in the server program (with different, the latter operating in the Applet browser end). In this book the Servlet chapter 4.Using this method, the entire page must have made in Java Servlet. If developers or Web managers want to adjust page, you'll have to e
15、dit 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.Obviously, what is needed is a industry to create dynamic content within the scope of the pages of the solution. This program w
16、ill solve the current scheme are limited. As follows: can on any Web server or applications.will application page displays and separation. can rapidly developing and testing. simplify the interactive development based on Web application process.The JSP technology is designed to meet such requirement
17、s. The JSP specification is a Web server, application server, trading system and develop extensive 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 a
18、nd tools. The result is a kind of new and developing method based on Web applications, using component-based application logic page designers with powerful functions.Overall Semantics of a JSP PageA JSP page implementation class defines a _jspService() method mapping from the request to the response
19、 object. Some details of this transformation are specific to the scripting language used (see Chapter JSP.9, “Scripting”). Most details are not language specific and are described in this chapter.The content of a JSP page is devoted largely to describing the data that is written into the output stre
20、am of the response. (The 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:Initially, out is a new JspWriter object. This object may b
21、e different from the stream object returned from response.getWriter(), and may be considered to be interposed on the latter in order to implement 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
22、the PrintWriter or OutputStream associated with the ServletResponse.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 using JSP as a language to “glue” actions tha
23、t 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, “Internationalization Issues”.Within the body of some actions, out may be temporarily re-assigned to a different (nested) instance of a
24、JspWriter object. Whether this is the case depends on the details of the actions 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 streams are
25、 always buffered, and require explicit flushing to a nesting stream or their contents will be discarded.If the initial out JspWriter object is buffered, then depending upon the value of the autoFlush attribute of the page directive, the content of that buffer will either be automatically flushed out
26、 to the ServletResponse output stream to obviate overflow, or an exception shall be thrown to signal buffer overflow. If the initial out JspWriter is unbuffered, then content written to it will be passed directly through to the ServletResponse output stream.A JSP page can also describe what should h
27、appen when some specific 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.JavaScript is used for the first kind is browser, the dynamic general pu
28、rpose of client scripting language. Netscape first proposed in 1995, but its JavaScript LiveScript called. Then quickly Netscape LiveScript renamed JavaScript, Java developers with them from the same issued a statement. A statement Java and JavaScript will complement each other, but they are differe
29、nt, so the technology of the many dismissed the misunderstanding of the two technologies.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 the cursor on the Web page of a mobile user inp
30、ut validation or transform image.Microsoft also write out their JavaScript version and the JScript called. Microsoft and Netscape support JavaScript and JScript around a core characteristics and European Manufacturers is.md by (ECMA) standards organization, the control standard of scripting language
31、. ECMA its scripting language ECMAScript named.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 information wherever it is needed, sinc
32、e 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 an organization's logo. In other cases, the information is more dynamic and changes often and unpredictably, s
33、uch as a textual greeting that must be localized for each user. In both cases, you want to ensure that the servlet or JSP can evolve independently of its included content, and that the implementation of the servlet or JSP properly updates its included content as necessary.You want to include a resou
34、rce that does not change very much (such as a page fragment that represents a header or footer) in a JSP. Use the include directive in the including JSP page, and give the included JSP segment a .jspf extension.You want to include content in a JSP each time it receives a request, rather than when th
35、e JSP is converted to a servlet. Use the jsp:include standard action.You want to include a file dynamically in a JSP, based on a value derived from a configuration file. Use the jsp:include standard action. Provide the value in an external properties file or as a configuration parameter in the deplo
36、yment descriptor.You want to include a fragment of an XML file inside of a JSP document, or include 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 o
37、ccur during the translation phase.You want to include a JSP segment from outside the including file's context. Use the c:importThe operation principle and the advantages of JSP tagsIn this section of the operating principle of simple introduction JSP and strengths.For the first time in a JSP doc
38、uments requested by the engine, JSP Servlet is transformed into a document JSP. This engine is itself a Servlet. The operating process of the JSP shown below:(1) the JSP engine put the JSP files converting a Java source files (Servlet), if you find the files have any grammar mistake JSP, conversion
39、process will interrupt, and to the server and client output error messages.(2) if converted, with the engine JSP javac Java source file compiler into a corresponding scale-up files.(3) to create a the Servlet (JSP page), the transformation of the Servlet jspInit () method was executed, jspInit () me
40、thod in the life cycle of Servlet executed only once.(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 engine will create multiple threads. Each clien
41、t 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 notice the multi-thread programming, due to the limited Servlet always in response to memory, so is very fast.(5) if the file has be
42、en modified. The JSP, server will be set according to the document to decide whether to recompile, if need to recompile, will replace the Servlet compile the memory and continue the process.(6) although the JSP efficiency is high, but at first when the need to convert and compile and some slight del
43、ay. 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.(7) and then Servlet examples were marked with "add" garbage collection. But in jspInit () som
44、e initialization work, if establish connection with database, or to establish a network connection, from a configuration file take some parameters, such as, in jspDestory () release of the corresponding resources.JSP技術(shù)簡(jiǎn)介及特點(diǎn)JSP(Java Server Pages)技術(shù)是由Sun公司發(fā)布的用于開(kāi)發(fā)動(dòng)態(tài)Web應(yīng)用的一項(xiàng)技術(shù)。它以其簡(jiǎn)單易學(xué)、跨平臺(tái)的特性,在眾多動(dòng)態(tài)Web應(yīng)用程
45、序設(shè)計(jì)語(yǔ)言中異軍突起,在短短幾年中已經(jīng)形成了一套完整的規(guī)范,并廣泛地應(yīng)用于電子商務(wù)等各個(gè)領(lǐng)域中。在國(guó)內(nèi),JSP現(xiàn)在也得到了比較廣泛的重視,得到了很好的發(fā)展,越來(lái)越多的動(dòng)態(tài)網(wǎng)站開(kāi)始采用JSP技術(shù)。下面就對(duì)JSP及其相關(guān)技術(shù)進(jìn)行簡(jiǎn)單的介紹。JSP技術(shù)可以以一種簡(jiǎn)捷而快速的方法生成Web頁(yè)面。使用JSP技術(shù)的Web頁(yè)面可以很容易地顯示動(dòng)態(tài)內(nèi)容。JSP技術(shù)的設(shè)計(jì)目的是使得構(gòu)造基于Web的應(yīng)用程序更加容易和快捷,而這些應(yīng)用程序能夠與各種Web服務(wù)器、應(yīng)用服務(wù)器、瀏覽器和開(kāi)發(fā)工具共同工作。JSP技術(shù)不是惟一的動(dòng)態(tài)網(wǎng)頁(yè)技術(shù),也不是第一個(gè),在JSP技術(shù)出現(xiàn)之前就已經(jīng)存在幾種優(yōu)秀的動(dòng)態(tài)網(wǎng)頁(yè)技術(shù),如CGI、ASP
46、等。下面結(jié)合這些技術(shù)的介紹,講述動(dòng)態(tài)網(wǎng)頁(yè)技術(shù)的發(fā)展和JSP技術(shù)的誕生。JSP的開(kāi)發(fā)背景及發(fā)展歷史在萬(wàn)維網(wǎng)短暫的歷史中,萬(wàn)維網(wǎng)已經(jīng)從一個(gè)大部分顯示靜態(tài)信息的網(wǎng)絡(luò)演化到對(duì)股票進(jìn)行交易和進(jìn)行購(gòu)書操作的一個(gè)基礎(chǔ)設(shè)施。在各種各樣的應(yīng)用程序中,對(duì)于可能使用的基于Web的客戶端,看上去沒(méi)有任何限制?;跒g覽器客戶端的應(yīng)用程序比傳統(tǒng)的基于客戶機(jī)/服務(wù)器的應(yīng)用程序有幾個(gè)好處。這些好處包括幾乎沒(méi)有限制的客戶端訪問(wèn)和極其簡(jiǎn)化的應(yīng)用程序部署和管理(要更新一個(gè)應(yīng)用程序,管理人員只需要更改一個(gè)基于服務(wù)器的程序,而不是成千上萬(wàn)的安裝在客戶端的應(yīng)用程序)。這樣,軟件工業(yè)正迅速地向建造基于瀏覽器客戶端的多層次應(yīng)用程序邁進(jìn)。這些
47、快速增長(zhǎng)的精巧的基于Web的應(yīng)用程序要求開(kāi)發(fā)技術(shù)上的改進(jìn)。靜態(tài)HTML對(duì)于顯示相對(duì)靜態(tài)的內(nèi)容是不錯(cuò)的選擇;新的挑戰(zhàn)在于創(chuàng)建交互的基于Web的應(yīng)用程序,在這些程序中,頁(yè)面的內(nèi)容是基于用戶的請(qǐng)求或者系統(tǒng)的狀態(tài),而不是預(yù)先定義的文字。對(duì)于這個(gè)問(wèn)題的一個(gè)早期解決方案是使用CGI-BIN接口。開(kāi)發(fā)人員編寫與接口相關(guān)的單獨(dú)的程序,以及基于Web的應(yīng)用程序,后者通過(guò)Web服務(wù)器來(lái)調(diào)用前者。這個(gè)方案有著嚴(yán)重的擴(kuò)展性問(wèn)題每個(gè)新的CGI要求在服務(wù)器上新增一個(gè)進(jìn)程。如果多個(gè)用戶并發(fā)地訪問(wèn)該程序,這些進(jìn)程將消耗該Web服務(wù)器所有的可用資源,并且系統(tǒng)性能會(huì)降低到極其低下的地步。某些Web服務(wù)器供應(yīng)商已經(jīng)嘗試通過(guò)為他們的
48、服務(wù)器提供“插件”和API來(lái)簡(jiǎn)化Web應(yīng)用程序的開(kāi)發(fā)。這些解決方案是與特定的Web服務(wù)器相關(guān)的,不能解決跨多個(gè)供應(yīng)商的解決方案的問(wèn)題。例如,微軟的Active Server Pages(ASP)技術(shù)使得在Web頁(yè)面上創(chuàng)建動(dòng)態(tài)內(nèi)容更加容易,但也只能工作在微軟的IIS和Personal Web Server上。還存在其他的解決方案,但都不能使一個(gè)普通的頁(yè)面設(shè)計(jì)者能夠輕易地掌握。例如,像Java Servlet這樣的技術(shù)就可以使得用Java語(yǔ)言編寫交互的應(yīng)用程序的服務(wù)器端的代碼變得容易。開(kāi)發(fā)人員能夠編寫出這樣的Servlet,以接收來(lái)自Web瀏覽器的HTTP請(qǐng)求,動(dòng)態(tài)地生成響應(yīng)(可能要查詢數(shù)據(jù)庫(kù)來(lái)完
49、成這項(xiàng)請(qǐng)求),然后發(fā)送包含HTML或XML文檔的響應(yīng)到瀏覽器。注意:一個(gè)Java Servlet就是一個(gè)基于Java技術(shù)的運(yùn)行在服務(wù)器端的程序(與Applet不同,后者運(yùn)行在瀏覽器端)。Servlet會(huì)在本書第4章介紹。采用這種方法,整個(gè)網(wǎng)頁(yè)必須都在Java Servlet中制作。如果開(kāi)發(fā)人員或者Web管理人員想要調(diào)整頁(yè)面顯示,就不得不編輯并重新編譯該Java Servlet,即使在邏輯上已經(jīng)能夠運(yùn)行了。采用這種方法,生成帶有動(dòng)態(tài)內(nèi)容的頁(yè)面仍然需要應(yīng)用程序的開(kāi)發(fā)技巧。很顯然,目前所需要的是一個(gè)業(yè)界范圍內(nèi)的創(chuàng)建動(dòng)態(tài)內(nèi)容頁(yè)面的解決方案。這個(gè)方案將解決當(dāng)前方案所受到的限制。如下:1) 能夠在任何We
50、b或應(yīng)用程序服務(wù)器上運(yùn)行。2) 將應(yīng)用程序邏輯和頁(yè)面顯示分離。3) 能夠快速地開(kāi)發(fā)和測(cè)試。4) 簡(jiǎn)化開(kāi)發(fā)基于Web的交互式應(yīng)用程序的過(guò)程。JSP技術(shù)就是被設(shè)計(jì)用來(lái)滿足這樣的要求的。JSP規(guī)范是Web服務(wù)器、應(yīng)用服務(wù)器、交易系統(tǒng)以及開(kāi)發(fā)工具供應(yīng)商間廣泛合作的結(jié)果。Sun開(kāi)發(fā)出這個(gè)規(guī)范來(lái)整合和平衡已經(jīng)存在的對(duì)Java編程環(huán)境(例如,Java Servlet和JavaBeans)進(jìn)行支持的技術(shù)和工具。其結(jié)果是產(chǎn)生了一種新的、開(kāi)發(fā)基于Web應(yīng)用程序的方法,給予使用基于組件應(yīng)用邏輯的頁(yè)面設(shè)計(jì)者以強(qiáng)大的功能。JSP頁(yè)實(shí)施類定義一個(gè)_ jspService() 方法映射反應(yīng)對(duì)象的請(qǐng)求。這些變革細(xì)節(jié)是具體用于
51、腳本語(yǔ)言(參見(jiàn)Chapter JSP.9, “Scripting”)。多數(shù)細(xì)節(jié)不是具體語(yǔ)言,這些細(xì)節(jié)在這個(gè)章節(jié)里描述。JSP頁(yè)的內(nèi)容主要致力于描述被寫入反應(yīng)的輸出流的數(shù)據(jù)(JSP容器通常傳送返回給客戶的數(shù)據(jù)。)描述是根據(jù)JspWriter對(duì)象它通過(guò)隱含對(duì)象暴露。(參見(jiàn)JSP.1.8.3, “Implicit Objects”)。首先, 定義一個(gè)JspWriter 對(duì)象,這個(gè)對(duì)象不同于response.getWriter()返回對(duì)象。并且為了實(shí)施中間轉(zhuǎn)換,可以認(rèn)為是插入到buffering。這是最初外在對(duì)象。JSP 頁(yè)作者對(duì)于PrintWriter 或OutputStream 相關(guān)的Servle
52、tResponse被禁止寫直接寫入。JSP容器不響應(yīng)response.getWriter()直到第一部份內(nèi)容送到客戶。JSP對(duì)“glue”動(dòng)作是一種語(yǔ)言,它是二進(jìn)制?;蛴趕ervlet相關(guān), 或在引起內(nèi)容之前改變反應(yīng)類型內(nèi)容。參照J(rèn)SP.4,“Internationalization Issues”. 在一些動(dòng)作主體中,輸出不同于JspWriter對(duì)象實(shí)例的再分配,這取決于動(dòng)作的細(xì)節(jié)。典型臨時(shí)數(shù)據(jù)流添加到先前的輸出流, 隨后輸出數(shù)據(jù)流再分配到先前數(shù)據(jù)流(嵌套)。Nested streams總被緩沖,并且明確要求緩沖嵌套數(shù)據(jù)流或被擯除的內(nèi)容。如果out JspWriter 對(duì)象數(shù)據(jù)緩沖區(qū)滿, 則
53、取決于autoFlush屬性值,緩沖內(nèi)容自動(dòng)輸入到ServletResponse output stream ,消除溢出;或拋出緩沖溢出的信號(hào)。如果JspWriter不溢出, 寫入的內(nèi)容將被直接送入ServletResponse輸出流。JSP頁(yè)也能描述一些應(yīng)該發(fā)生的具體事件。在JSP 2.1, 可被描述的唯一事件是初始化和頁(yè)的損壞。在聲明元素“well-known methodnames”中描述。(參見(jiàn)JSP., “Protocol Seen by theJSP Page Author”).JavaScript是用于瀏覽器的第一種具有通用目的、動(dòng)態(tài)的客戶端腳本語(yǔ)言。Netscape于1995年首先提出了JavaScript,
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年信陽(yáng)c1客運(yùn)從業(yè)資格證怎么考
- 2024年福州客運(yùn)上崗證考試題多少道題
- 2024年貴陽(yáng)客運(yùn)資格證考試答題
- 2024年太原客運(yùn)從業(yè)資格證考試模擬
- 2024年北京客運(yùn)從業(yè)資格證模擬考試試題題庫(kù)答案
- 2024年寶雞駕??荚嚳瓦\(yùn)從業(yè)資格證考試題庫(kù)
- 小學(xué)五年級(jí)信息技術(shù)教案合集六篇
- 全省技工院校職業(yè)技能大賽技術(shù)文件-數(shù)控車工技術(shù)文件(高級(jí)組)
- 2024-2025學(xué)年山東省聊城市冠縣統(tǒng)編版六年級(jí)上冊(cè)期中考試道德與法治試卷
- 安徽省六安市霍山文峰學(xué)校2024-2025學(xué)年高一上學(xué)期第二次調(diào)研考試 化學(xué)試題
- 2022年《父母課堂》如何幫助孩子順利度過(guò)小學(xué)分化年級(jí)教學(xué)案例
- 幕墻拆除施工方案-(2)
- 8安全記心上 (3)
- 感染性心內(nèi)膜炎ppt課件
- 青春期人際交往
- 職工環(huán)保教育培訓(xùn)檔案最新版本
- 2022年導(dǎo)管相關(guān)性血流感染(CRBSI)監(jiān)測(cè)規(guī)范及操作手冊(cè)
- 剪紙英文介紹paper cutting(課堂PPT)
- 研究生課件graphpad prism7作圖教程
- 入行論32課(課堂PPT)
- RSlogix500編程PPT課件
評(píng)論
0/150
提交評(píng)論