版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、<p> 附錄1 外文參考文獻(xiàn)(譯文)</p><p><b> JSP內(nèi)置對(duì)象</b></p><p> 有些對(duì)象不用聲明就可以在JSP頁面的Java程序片和表達(dá)式部分使用,這就是JSP的內(nèi)置對(duì)象。</p><p> JSP的內(nèi)置對(duì)象有:request、response、session、application、out.&l
2、t;/p><p> response和request對(duì)象是JSP內(nèi)置對(duì)象中較重要的兩個(gè),這兩個(gè)對(duì)象提供了對(duì)服務(wù)器和瀏覽器通信方法的控制。直接討論這兩個(gè)對(duì)象前,要先對(duì)HTTP協(xié)議—Word Wide Wed底層協(xié)議做簡(jiǎn)單介紹。</p><p> Word Wide Wed是怎樣運(yùn)行的呢?在瀏覽器上鍵入一個(gè)正確的網(wǎng)址后,若一切順利,網(wǎng)頁就出現(xiàn)了。使用瀏覽器從網(wǎng)站獲取HTML頁面時(shí),實(shí)際在使用超
3、文本傳輸協(xié)議。HTTP規(guī)定了信息在Internet上的傳輸方法,特別是規(guī)定吧瀏覽器與服務(wù)器的交互方法。從網(wǎng)站獲取頁面時(shí),瀏覽器在網(wǎng)站上打開了一個(gè)對(duì)網(wǎng)絡(luò)服務(wù)器的連接,并發(fā)出請(qǐng)求。服務(wù)器收到請(qǐng)求后回應(yīng),所以HTTP協(xié)議的核心就是“請(qǐng)求和響應(yīng)”。</p><p> 一個(gè)典型的請(qǐng)求通常包含許多頭,稱作請(qǐng)求的HTTP頭。頭提供了關(guān)于信息體的附加信息及請(qǐng)求的來源。其中有些頭是標(biāo)準(zhǔn)的,有些和特定的瀏覽器有關(guān)。一個(gè)請(qǐng)求還可能包
4、含信息體,例如,信息體可包含HTML表單的內(nèi)容。在HTML表單上單擊Submit鍵時(shí),該表單使用ACTION=”POST”或ACTION=”GET”方法,輸入表單的內(nèi)容都被發(fā)送到服務(wù)器上。該表單內(nèi)容就由POST方法或GET方法在請(qǐng)求的信息體中發(fā)送。</p><p> 服務(wù)器發(fā)送請(qǐng)求時(shí),返回HTTP響應(yīng)。響應(yīng)也有某種結(jié)構(gòu),每個(gè)響應(yīng)都由狀態(tài)行開始,可以包含幾個(gè)頭及可能的信息體,稱為響應(yīng)的HTTP頭和響應(yīng)信息體,這些
5、頭和信息體由服務(wù)器發(fā)送給客戶的瀏覽器,信息體就是客戶請(qǐng)求的網(wǎng)頁的運(yùn)行結(jié)果,對(duì)于JSP頁面,就是網(wǎng)頁的靜態(tài)信息。用戶可能已經(jīng)熟悉狀態(tài)行,狀態(tài)行說明了正在使用的協(xié)議、狀態(tài)代碼及文本信息。例如,若服務(wù)器請(qǐng)求出錯(cuò),則狀態(tài)行返回錯(cuò)誤及對(duì)錯(cuò)誤描述,比如HTTP/1.1 404 Object Not Found。若服務(wù)器成功響應(yīng)了對(duì)頁面的請(qǐng)求,則返回包含“200 OK”的狀態(tài)行。</p><p> HTTP通信協(xié)議是客戶與服
6、務(wù)器之間一種提交(請(qǐng)求)信息與響應(yīng)信息(request/response)的通信協(xié)議。在JSP中,內(nèi)置對(duì)象request封裝了用戶提交的信息,那么該對(duì)象調(diào)用相應(yīng)的方法可以獲取封裝的信息,使用該對(duì)象可以獲取用戶提交的信息。內(nèi)置對(duì)象request對(duì)象是實(shí)現(xiàn)了SerletRequest接口類的一個(gè)實(shí)例,可以在Tomcat服務(wù)器的webapps\tomcat-docs\servletapi中查找SerletRequest接口的方法。</p
7、><p> 當(dāng)客戶訪問一個(gè)服務(wù)器的頁面時(shí),會(huì)提交一個(gè)HTTP請(qǐng)求,服務(wù)器收到請(qǐng)求時(shí),返回HTTP響應(yīng)。響應(yīng)和請(qǐng)求類似,也有某種結(jié)構(gòu),每個(gè)響應(yīng)都由狀態(tài)行開始,可以包含幾個(gè)頭及可能的信息體。與request對(duì)象相對(duì)應(yīng)的對(duì)象是response對(duì)象??梢杂胷esponse對(duì)象對(duì)客戶的請(qǐng)求作出動(dòng)態(tài)響應(yīng),向客戶端發(fā)送數(shù)據(jù)。比如,當(dāng)一個(gè)客戶請(qǐng)求訪問一個(gè)JSP頁面時(shí),該頁面用page指令設(shè)置頁面的contentType屬性的值是t
8、ext/html,那么JSP引擎將這種屬性值響應(yīng)客戶對(duì)頁面的請(qǐng)求,將頁面的靜態(tài)部分返回給客戶,用戶瀏覽器接收到該響應(yīng)就會(huì)使用HTML解釋器解釋執(zhí)行所收到的信息。</p><p> HTTP協(xié)議是一種無狀態(tài)協(xié)議。一個(gè)客戶向服務(wù)器發(fā)出請(qǐng)求(),然后服務(wù)器返回響應(yīng)(),連接就被關(guān)閉了。在服務(wù)器端不保留連接的有關(guān)信息,因此當(dāng)下一次連接時(shí),服務(wù)器已經(jīng)沒有以前的連接信息了,無法判斷這一次連接和以前的連接是否屬于同一個(gè)客戶。
9、當(dāng)一個(gè)客戶訪問一個(gè)Web服務(wù)目錄時(shí),可能會(huì)在這個(gè)服務(wù)器目錄的幾個(gè)頁面反復(fù)連接、反復(fù)刷新一個(gè)頁面或不斷的向一個(gè)頁面提交信息等,服務(wù)器應(yīng)當(dāng)通過某種辦法知道這是同一個(gè)客戶。Tomcat服務(wù)器可以使用內(nèi)置session(會(huì)話)對(duì)象記錄有關(guān)連接的信息。內(nèi)置對(duì)象session由Tomcat服務(wù)器負(fù)責(zé)創(chuàng)建,session是實(shí)現(xiàn)了HttpSession接口類的一個(gè)實(shí)例,可以在Tomcat服務(wù)器的webapps\tomcat-docs\servletap
10、i中查找HttpSession接口方法。</p><p> 我們已經(jīng)知道,當(dāng)一各客戶第一次訪問Web服務(wù)目錄上的一個(gè)JSP頁面,JSP引擎創(chuàng)建一個(gè)和該客戶相對(duì)應(yīng)的session對(duì)象,當(dāng)客戶在所訪問的Web服務(wù)目錄的各個(gè)頁面之間瀏覽時(shí),這個(gè)session對(duì)象都是同一個(gè),而且不同客戶的session對(duì)象是互不相同的。與session對(duì)象不同的是 application對(duì)象,該對(duì)象由服務(wù)器負(fù)責(zé)創(chuàng)建,每個(gè)Web服務(wù)目錄
11、下的application對(duì)象被訪問該服務(wù)目錄的所有的用戶共享,不同Web服務(wù)目錄下的application互不相同。</p><p> Out對(duì)象是一個(gè)輸出流,用來向客戶端輸出數(shù)據(jù)。Out對(duì)象可調(diào)用如下的方法用于各種數(shù)據(jù)的輸出,例如:</p><p> Out.print(boolean),out.println(boolean):輸出一個(gè)布爾值。</p><p&
12、gt; Out.print(char),out.println(char):輸出一個(gè)布爾值。</p><p> Out.print(double),out.println(double):輸出一個(gè)布爾值。</p><p> Out.print(float),out.println(float):輸出一個(gè)布爾值。</p><p> Out.print(long
13、),out.println(long):輸出一個(gè)布爾值。</p><p> Out.print(String),out.println(String):輸出一個(gè)布爾值。</p><p> Out.newLine():輸出一個(gè)換行符。</p><p> Out.flush():輸出緩沖區(qū)里的內(nèi)容。</p><p> Out.close(
14、):關(guān)閉流。</p><p> 方法println 和print的區(qū)別是:println會(huì)向緩存區(qū)寫入一個(gè)換行,而print不寫入換行。但是瀏覽器的顯示區(qū)域目前不識(shí)別println寫入的換行,如果希望瀏覽器顯示換行,應(yīng)當(dāng)向?yàn)g覽器寫入<br>實(shí)現(xiàn)換行。</p><p> 附錄2 外文參考文獻(xiàn)(原文)</p><p> JSP built-in ob
15、jects</p><p> Some objects do not have a statement on the JSP page in the Java program and the expression of some of the use of film, which is built-in objects of the JSP.</p><p> JSP has the
16、built-in objects: request, response, session, application, out. </p><p> response and request object is a built-in object in the JSP of the two more important, the two clients, the server and browser commun
17、ication control. Directly to discuss the two objects before the first of the HTTP protocol-Word Wide Wed underlying agreement to do a brief introduction.</p><p> Word Wide Wed is how to run it? In a browser
18、, type the correct URL, if all goes well, there have been web page. The use of browser access to HTML pages from the site, the actual use of Hypertext Transfer Protocol. HTTP provides information on the Internet transmis
19、sion methods, in particular the provisions of your browser and server interaction method. Page from the website, the browser open on the site of a connection to the server on the network, and issued the request. Server i
20、n response to re</p><p> A typical request usually contains a number of the first, known as the HTTP request header. Provided the first body of information and request additional information sources. Some o
21、f the first is a standard, and some of the specific browser. A request may also contain information, such as, information form body can contain HTML content. In HTML form, click Submit button, the form to use ACTION = &q
22、uot;POST" or ACTION = "GET" method, enter the contents of the form have been sent to the server. The con</p><p> Server to send request, return HTTP response. Have some structure to respond t
23、o each by the state to respond to the start line, may include a number of head and body of information may be known as the HTTP response headers and body to respond to information, the head and body of information sent b
24、y the server to the client browser, body of information that customers request the results page for the JSP page is static information pages. Users may have been familiar with the status line, status li</p><p&
25、gt; HTTP communication protocol between a client and a server to submit (Request) information and respond to information (request / response) communication protocol. In the JSP, the built-in object request package of in
26、formation submitted by the user, then the object can call the appropriate method to obtain the information package, the use of the object can get users to submit information. Built-in object request is a type of interfac
27、e SerletRequest an example of Tomcat server in the webapps \ tomc</p><p> When a customer visits a page the server will be submitted to an HTTP request, the server receives a request, the HTTP response to r
28、eturn. Response and a similar request, but also a structure, by each state to respond to the start line, may include a number of head and body may be information. With the corresponding request object is the target respo
29、nse. Response object can be used on the client's request for a dynamic response, send data to the client. For example, when a client requests access</p><p> HTTP protocol is a stateless protocol. A clie
30、nt request to the server (), and then the server returns in response to (), connection has been closed. Not to retain the server-side connection information, so next time to connect, the server has no previous connection
31、 information to be able to judge this time to connect and the former belong to the same connection is a client. When a customer visits a Web services directory may be in the directory server to connect a few pages again
32、and repeated co</p><p> We already know that when a customer's first visit to the Web services directory on a JSP page, JSP engine and the client to create a corresponding object of the session, when cu
33、stomers visit the various Web services directory browsing between pages, this session are the same object, and session objects of different clients is a separate one. With the session object is a different application ob
34、ject, the object created by the server, each Web services application directory service object was to </p><p> Out object is an output stream, used to output data to the client. Out object can call the foll
35、owing method has been applied to the output of various data, such as:</p><p> Out.print (boolean), out.println (boolean): output a boolean value. </p><p> Out.print (char), out.println (char):
36、 output a boolean value. </p><p> Out.print (double), out.println (double): output a boolean value. </p><p> Out.print (float), out.println (float): output a boolean value. </p><p&g
37、t; Out.print (long), out.println (long): output a boolean value. </p><p> Out.print (String), out.println (String): output a boolean value. </p><p> Out.newLine (): output a newline. </p&
38、gt;<p> Out.flush (): output buffer's content. </p><p> Out.close (): close the stream.</p><p> Println and print methods is the difference between: println to write a cache line,
39、and the print is not written into the line. However, the browser display area is not currently written into the identification of the println line, if you want to show the line browser, it should be written to the browse
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 計(jì)算機(jī)專業(yè)畢業(yè)外文翻譯--jsp簡(jiǎn)介
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)外文翻譯
- 計(jì)算機(jī)專業(yè)畢業(yè)外文翻譯--jsp技術(shù)概述
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)-外文翻譯
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)外文翻譯27
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)外文翻譯--internet
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)(論文)外文翻譯--jsp技術(shù)發(fā)展史
- 計(jì)算機(jī)專業(yè)外文翻譯---jsp 應(yīng)用框架
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)外文資料翻譯3
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)-外文翻譯--matlab 介紹
- 計(jì)算機(jī)畢業(yè)設(shè)計(jì)外文翻譯
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯部分
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)外文翻譯--數(shù)據(jù)庫
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)文獻(xiàn)翻譯
- 計(jì)算機(jī)專業(yè)畢業(yè)外文翻譯
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)(論文)外文翻譯2篇
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)外文翻譯--ds1820
- 計(jì)算機(jī)專業(yè)外文翻譯--計(jì)算機(jī)
- 計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)外文翻譯--組策略的概述
- 計(jì)算機(jī)專業(yè)--畢業(yè)設(shè)計(jì)外文翻譯--論網(wǎng)站建設(shè)技術(shù)
評(píng)論
0/150
提交評(píng)論