版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、<p><b> 外文原文</b></p><p><b> JSP</b></p><p> JSP (JavaServer Pages) is initiated by Sun Microsystems, Inc., with many companies to participate in the establishment
2、 of a dynamic web page technical standards. JSP technology somewhat similar to ASP technology, it is in the traditional HTML web page document (*. htm, *. html) to insert the Java programming paragraph (Scriptlet) and JS
3、P tag (tag), thus JSP documents (*. jsp). </p><p> Using JSP development of the Web application is cross-platform that can run on Linux, is also available for other operating systems. </p><p>
4、 JSP technology to use the Java programming language prepared by the category of XML tags and scriptlets, to produce dynamic pages package processing logic. Page also visit by tags and scriptlets exist in the services si
5、de of the resources of logic. JSP page logic and web page design and display separation, support reusable component-based design, Web-based application development is rapid and easy. </p><p> Web server in
6、the face of visits JSP page request, the first implementation of the procedures of, and then together with the results of the implementation of JSP documents in HTML code with the return to the customer. Insert the Java
7、programming operation of the database can be re-oriented websites, in order to achieve the establishment of dynamic pages needed to function. </p><p> JSP and Java Servlet, is in the implementation of the s
8、erver, usually returned to the client is an HTML text, as long as the client browser will be able to visit. </p><p> JSP 1.0 specification of the final version is launched in September 1999, December has in
9、troduced 1.1 specifications. At present relatively new is JSP1.2 norms, JSP2.0 norms of the draft has also been introduced. </p><p> JSP pages from HTML code and Java code embedded in one of the components.
10、 The server was in the pages of client requests after the Java code and then will generate the HTML pages to return to the client browser. Java Servlet JSP is the technical foundation and large-scale Web application deve
11、lopment needs of Java Servlet and JSP support to complete. JSP with the Java technology easy to use, fully object-oriented, and a platform-independent and secure, mainly for all the characteristics of the In</p>&
12、lt;p> JavaScript, which is completely distinct from the Java programming language, is normally used to dynamically generate HTML on the client, building parts of the Web page as the browser loads the document. This i
13、s a useful capability and does not normally overlap with the capabilities of JSP (which runs only on the server). JSP pages still include SCRIPT tags for JavaScript, just as normal HTML pages do. In fact, JSP can even be
14、 used to dynamically generate the JavaScript that will be sent to the </p><p> JSP (a recursive acronym for "JSP: Hypertext Preprocessor") is a free, open-source, HTML-embedded scripting language
15、that is somewhat similar to both ASP and JSP. One advantage of JSP is that the dynamic part is written in Java, which already has an extensive API for networking, database access, distributed objects, and the like, where
16、as PHP requires learning an entirely new, less widely used language. A second advantage is that JSP is much more widely supported by tool and server vendors than i</p><p> JSP doesn't provide any capabi
17、lities that couldn't, in principle, be accomplished with servlets. In fact, JSP documents are automatically translated into servlets behind the scenes. But it is more convenient to write (and to modify!) regular HTML
18、 than to use a zillion println statements to generate the HTML. Plus, by separating the presentation from the content, you can put different people on different tasks: your Web page design experts can build the HTML by u
19、sing familiar tools and either lea</p><p> Does this mean that you can just learn JSP and forget about servlets? Absolutely not! JSP developers need to know servlets for four reasons:</p><p>
20、JSP pages get translated into servlets. You can't understand how JSP works without understanding servlets.</p><p> JSP consists of static HTML, special-purpose JSP tags, and Java code. What kind of Java
21、 code? Servlet code! You can't write that code if you don't understand servlet programming.</p><p> Some tasks are better accomplished by servlets than by JSP. JSP is good at generating pages that c
22、onsist of large sections of fairly well structured HTML or other character data. Servlets are better for generating binary data, building pages with highly variable structure, and performing tasks (such as redirection) t
23、hat involve little or no output.</p><p> Some tasks are better accomplished by a combination of servlets and JSP than by either servlets or JSP alone.</p><p> JSP technology strength </p>
24、;<p> (1) time to prepare, run everywhere. At this point Java better than PHP, in addition to systems, the code not to make any changes. </p><p> (2) the multi-platform support. Basically on all pla
25、tforms of any development environment, in any environment for deployment in any environment in the expansion. Compared ASP / PHP limitations are obvious. </p><p> (3) a strong scalability. From only a small
26、 Jar documents can run Servlet JSP, to the multiple servers clustering and load balancing, to multiple Application for transaction processing, information processing, a server to numerous servers, Java shows a tremendous
27、 Vitality. </p><p> (4) diversification and powerful development tools support. This is similar to the ASP, Java already have many very good development tools, and many can be free, and many of them have be
28、en able to run on a variety of platforms under. </p><p> JSP technology vulnerable:</p><p> (1) and the same ASP, Java is the advantage of some of its fatal problem. It is precisely because in
29、 order to cross-platform functionality, in order to extreme stretching capacity, greatly increasing the complexity of the product. </p><p> (2) Java's speed is class to complete the permanent memory, so
30、 in some cases by the use of memory compared to the number of users is indeed a "minimum cost performance." On the other hand, it also needs disk space to store a series of. Java documents and. Class, as well a
31、s the corresponding versions of documents. </p><p> Know servlets for four reasons:</p><p> 1. JSP pages get translated into servlets. You can't understand how JSP works without understand
32、ing servlets.</p><p> 2. JSP consists of static HTML, special-purpose JSP tags, and Java code. What kind of Java code? Servlet code! You can't write that code if you don't understand servlet program
33、ming.</p><p> 3. Some tasks are better accomplished by servlets than by JSP. JSP is good at generating pages that consist of large sections of fairly well structured HTML or other character data. Servlets a
34、re better for generating binary data, building pages with highly variable structure, and performing tasks (such as redirection) that involve little or no output.</p><p> 4. Some tasks are better accomplishe
35、d by a combination of servlets and JSP than by either servlets or JSP alone. </p><p> Versus JavaScript</p><p> JavaScript, which is completely distinct from the Java programming language, is
36、normally used to dynamically generate HTML on the client, building parts of the Web page as the browser loads the document. This is a useful capability and does not normally overlap with the capabilities of JSP (which r
37、uns only on the server). JSP pages still include SCRIPT tags for JavaScript, just as normal HTML pages do. In fact, JSP can even be used to dynamically generate the JavaScript that will be sent to the</p><p>
38、; JSP is by no means perfect. Many people have pointed out features that could be improved. This is a good thing, and one of the advantages of JSP is that the specification is controlled by a community that draws from m
39、any different companies. So, the technology can incorporate improvements in successive releases.</p><p> However, some groups have developed alternative Java-based technologies to try to address these defic
40、iencies. This, in our judgment, is a mistake. Using a third-party tool like Apache Struts that augments JSP and servlet technology is a good idea when that tool adds sufficient benefit to compensate for the additional co
41、mplexity. But using a nonstandard tool that tries to replace JSP is a bad idea. When choosing a technology, you need to weigh many factors: standardization, portability, integrati</p><p> JSP six built-in o
42、bjects: </p><p> request, response, out, session, application, config, pagecontext, page, exception. </p><p> ONE. Request for: </p><p> The object of the package of information
43、submitted by users, by calling the object corresponding way to access the information package, namely the use of the target users can access the information. </p><p> TWO. Response object: </p><p
44、> The customer's request dynamic response to the client sent the data. </p><p> THREE. session object </p><p> 1. What is the session: session object is a built-in objects JSP, it in t
45、he first JSP pages loaded automatically create, complete the conversation of management. </p><p> From a customer to open a browser and connect to the server, to close the browser, leaving the end of this s
46、erver, known as a conversation. When a customer visits a server, the server may be a few pages link between repeatedly, repeatedly refresh a page, the server should be through some kind of way to know this is the same cl
47、ient, which requires session object. </p><p> 2. session object ID: When a customer's first visit to a server on the JSP pages, JSP engines produce a session object, and assigned a String type of ID num
48、ber, JSP engine at the same time, the ID number sent to the client, stored in Cookie, this session objects, and customers on the establishment of a one-to-one relationship. When a customer to connect to the server of the
49、 other pages, customers no longer allocated to the new session object, until, close your browser, the client-server object t</p><p> FORE. aplication target </p><p> 1. What is the application
50、: </p><p> Servers have launched after the application object, when a customer to visit the site between the various pages here, this application objects are the same, until the server is down. But with the
51、 session difference is that all customers of the application objects are the same, that is, all customers share this built-in application objects. </p><p> 2. application objects commonly used methods: <
52、/p><p> (1) public void setAttribute (String key, Object obj): Object specified parameters will be the object obj added to the application object, and to add the subject of the designation of a keyword index.
53、</p><p> (2) public Object getAttribute (String key): access to application objects containing keywords for. </p><p> FIVE. out targets </p><p> out as a target output flow, used
54、 to client output data. out targets for the output data. </p><p> SIX. Cookie </p><p> 1. What is Cookie: </p><p> Cookie is stored in Web server on the user's hard drive sec
55、tion of the text. Cookie allow a Web site on the user's computer to store information on and then get back to it. </p><p> For example, a Web site may be generated for each visitor a unique ID, and then
56、 to Cookie in the form of documents stored in each user's machine. </p><p> If you use IE browser to visit Web, you will see all stored on your hard drive on the Cookie. They are most often stored in pl
57、aces: c: \ windows \ cookies (in Window2000 is in the C: \ Documents and Settings \ your user name \ Cookies) </p><p> Cookie is "keyword key = value value" to preserve the format of the record. &
58、lt;/p><p> 2. Targets the creation of a Cookie, Cookie object called the constructor can create a Cookie. Cookie object constructor has two string parameters: Cookie Cookie name and value. </p><p>
59、; Cookie c = new Cookie ( "username", "john"); </p><p> 3. If the JSP in the package good Cookie object to send to the client, the use of the response addCookie () method. </p>&
60、lt;p> Format: response.addCookie (c) </p><p> 4. Save to read the client's Cookie, the use of the object request getCookies () method will be implemented in all client came to an array of Cookie obj
61、ects in the form of order, to meet the need to remove the Cookie object, it is necessary to compare an array cycle Each target keywords.</p><p><b> 外文翻譯</b></p><p><b> JSP<
62、;/b></p><p> JSP(JavaServer Pages)是由Sun Microsystems公司倡導(dǎo)、許多公司參與一起建立的一種動(dòng)態(tài)網(wǎng)頁技術(shù)標(biāo)準(zhǔn)。JSP技術(shù)有點(diǎn)類似ASP技術(shù),它是在傳統(tǒng)的網(wǎng)頁HTML文件(*.htm,*.html)中插入Java程序段(Scriptlet)和JSP標(biāo)記(tag),從而形成JSP文件(*.jsp)。 </p><p> 用JSP開發(fā)的
63、Web應(yīng)用是跨平臺(tái)的,即能在Linux下運(yùn)行,也能在其他操作系統(tǒng)上運(yùn)行。</p><p> JSP技術(shù)使用Java編程語言編寫類XML的tags和scriptlets,來封裝產(chǎn)生動(dòng)態(tài)網(wǎng)頁的處理邏輯。網(wǎng)頁還能通過tags和scriptlets訪問存在于服務(wù)端的資源的應(yīng)用邏輯。JSP將網(wǎng)頁邏輯與網(wǎng)頁設(shè)計(jì)和顯示分離,支持可重用的基于組件的設(shè)計(jì),使基于Web的應(yīng)用程序的開發(fā)變得迅速和容易。 </p>&l
64、t;p> Web服務(wù)器在遇到訪問JSP網(wǎng)頁的請(qǐng)求時(shí),首先執(zhí)行其中的程序段,然后將執(zhí)行結(jié)果連同JSP文件中的HTML代碼一起返回給客戶。插入的Java程序段可以操作數(shù)據(jù)庫、重新定向網(wǎng)頁等,以實(shí)現(xiàn)建立動(dòng)態(tài)網(wǎng)頁所需要的功能。 </p><p> JSP與Java Servlet一樣,是在服務(wù)器端執(zhí)行的,通常返回該客戶端的就是一個(gè)HTML文本,因此客戶端只要有瀏覽器就能瀏覽。 </p><p
65、> JSP的1.0規(guī)范的最后版本是1999年9月推出的,12月又推出了1.1規(guī)范。目前較新的是JSP1.2規(guī)范,JSP2.0規(guī)范的征求意見稿也已出臺(tái)。</p><p> JSP頁面由HTML代碼和嵌入其中的Java代碼所組成。服務(wù)器在頁面被客戶端請(qǐng)求以后對(duì)這些Java代碼進(jìn)行處理,然后將生成的HTML頁面返回給客戶端的瀏覽器。Java Servlet 是JSP的技術(shù)基礎(chǔ),而且大型的Web應(yīng)用程序的開發(fā)需
66、要Java Servlet和JSP配合才能完成。JSP具備了Java技術(shù)的簡單易用,完全的面向?qū)ο?,具有平臺(tái)無關(guān)性且安全可靠,主要面向因特網(wǎng)的所有特點(diǎn)。 </p><p> 許多年前,Marty受到邀請(qǐng),參加一個(gè)有關(guān)軟件技術(shù)的小型(20個(gè)人)研討會(huì).做在Marty旁邊的人是James Gosling--- Java編程語言的發(fā)明者。隔幾個(gè)位置,是來自華盛頓一家大型軟件公司的高級(jí)經(jīng)理。在討論過程中,研討會(huì)的主席提
67、出了Jini的議題,這在當(dāng)時(shí)是一項(xiàng)新的Java技術(shù).主席向該經(jīng)理詢問他的想法.他繼續(xù)說,他們會(huì)持續(xù)關(guān)注這項(xiàng)技術(shù),如果這項(xiàng)技術(shù)變得流行起來,他們會(huì)遵循公司的“接受并擴(kuò)充(embrace and extend)的策略。此時(shí),Gosling隨意地插話說“你的意思其實(shí)就是不接受且不擴(kuò)充(disgrace and distend)。”</p><p> JSP頁面最終會(huì)轉(zhuǎn)換成servler。因而,從根本上,JSP頁面能夠
68、執(zhí)行的任何任務(wù)都可以用servler來完成。然而,這種底層的等同性并不意味著servler和JSP頁面對(duì)于所有的情況都等同適用。問題不在于技術(shù)的能力,而是二者在便利性、生產(chǎn)率和可維護(hù)性上的不同。畢竟,在特定平臺(tái)上能夠用Java編程語言完成的事情,同樣可以用匯編語言來完成,但是選擇哪種語言依舊十分重要。</p><p> 和單獨(dú)使用servler相比,JSP提供下述好處:</p><p>
69、 JSP中HTML的編寫與維護(hù)更為簡單。JSP中可以使用常規(guī)的HTML:沒有額外的反斜杠,沒有額外的雙引號(hào),也沒有暗含的Java語法。</p><p> 能夠使用標(biāo)準(zhǔn)的網(wǎng)站開發(fā)工具。即使對(duì)那些對(duì)JSP一無所知的HTML工具,我們也可以使用,因?yàn)樗鼈儠?huì)忽略JSP標(biāo)簽(JSP tags)。</p><p> 可以對(duì)開發(fā)團(tuán)隊(duì)進(jìn)行劃分。Java程序員可以致力于動(dòng)態(tài)代碼。Web開發(fā)人員可以將經(jīng)
70、理集中在表示層(presentation layer)上。對(duì)于大型的項(xiàng)目,這種劃分極為重要。依據(jù)開發(fā)團(tuán)隊(duì)的大小,及項(xiàng)目的復(fù)雜程度,可以對(duì)靜態(tài)HTML和動(dòng)態(tài)內(nèi)容進(jìn)行弱分離(weaker separation)和強(qiáng)分離(stronger separation)。在此,這個(gè)討論并不是讓您停止使用servlets,只使用JSP。幾乎所有的項(xiàng)目都會(huì)同時(shí)用到這兩種技術(shù)。針對(duì)項(xiàng)目中的某些請(qǐng)求,您可能會(huì)在MVC構(gòu)架下組合使用這兩項(xiàng)技術(shù)。我們總是希望用適
71、當(dāng)?shù)墓ぞ咄瓿上鄬?duì)應(yīng)的工作,僅僅是servlet并不能填滿您的工具箱。</p><p><b> JSP技術(shù)的強(qiáng)勢(shì)</b></p><p> (1) 一次編寫,到處運(yùn)行。在這一點(diǎn)上Java比PHP更出色,除了系統(tǒng)之外,代碼不用做任何更改。</p><p> (2) 系統(tǒng)的多平臺(tái)支持。基本上可以在所有平臺(tái)上的任意環(huán)境中開發(fā),在任意環(huán)境中進(jìn)行系
72、統(tǒng)部署,在任意環(huán)境中擴(kuò)展。相比ASP/PHP的局限性是顯而易見的。 </p><p> (3) 強(qiáng)大的可伸縮性。從只有一個(gè)小的Jar文件就可以運(yùn)行Servlet/JSP,到由多臺(tái)服務(wù)器進(jìn)行集群和負(fù)載均衡,到多臺(tái)Application進(jìn)行事務(wù)處理,消息處理,一臺(tái)服務(wù)器到無數(shù)臺(tái)服務(wù)器,Java顯示了一個(gè)巨大的生命力。 </p><p> (4) 多樣化和功能強(qiáng)大的開發(fā)工具支持。這一點(diǎn)與AS
73、P很像,Java已經(jīng)有了許多非常優(yōu)秀的開發(fā)工具,而且許多可以免費(fèi)得到,并且其中許多已經(jīng)可以順利的運(yùn)行于多種平臺(tái)之下。 </p><p><b> JSP技術(shù)的弱勢(shì):</b></p><p> (1) 與ASP一樣,Java的一些優(yōu)勢(shì)正是它致命的問題所在。正是由于為了跨平臺(tái)的功能,為了極度的伸縮能力,所以極大的增加了產(chǎn)品的復(fù)雜性。 </p><p
74、> (2) Java的運(yùn)行速度是用class常駐內(nèi)存來完成的,所以它在一些情況下所使用的內(nèi)存比起用戶數(shù)量來說確實(shí)是“最低性能價(jià)格比”了。從另一方面,它還需要硬盤空間來儲(chǔ)存一系列的.java文件和.class文件,以及對(duì)應(yīng)的版本文件。</p><p> 需要了解Servlet:</p><p> JSP頁面會(huì)轉(zhuǎn)換成Servlet。不了解Servlet就無法知道JSP如何工作。&l
75、t;/p><p> JSP由靜態(tài)HTML、專用的JSP標(biāo)簽和Java代碼組成。哪種類型的Java代碼呢?當(dāng)然是Servlet代碼!如果不了解Servlet編程,那么就無法編寫這種代碼。 (3) 一些任務(wù)用Servlet完成比用JSP來完成要好。JSP擅長生成由大量組織有序的結(jié)構(gòu)化HTML或其他字符數(shù)據(jù)組成的頁面。Servlet擅長生成二進(jìn)制數(shù)據(jù),構(gòu)建結(jié)構(gòu)多樣的頁面,以及執(zhí)行輸出很少或者沒有輸出的任務(wù)(比如重定向)。
76、(4) 有些任務(wù)更適合于組合使用Servlet和JSP來完成,而非單獨(dú)使用Servlet或JSP。 </p><p> 與JavaScript相比</p><p> JavaScript和Java編程語言完全是兩碼事,前者一般用于在客戶端動(dòng)態(tài)生成HTML,在瀏覽器載入文檔時(shí)構(gòu)建網(wǎng)頁的部分內(nèi)容。這是一項(xiàng)有用的功能,一般與JSP的功能(只在服務(wù)器端運(yùn)行)并不發(fā)生重疊。和常規(guī)HTML頁面一
77、樣,JSP頁面依舊可以包括用于JavaScript的SCRIPT標(biāo)簽。實(shí)際上,JSP甚至能夠用來動(dòng)態(tài)生成發(fā)送到客戶端的JavaScript。因此,JavaScript不是一項(xiàng)競爭技術(shù),它是一項(xiàng)補(bǔ)充技術(shù)。</p><p> JavaScript也可以用在服務(wù)器端,最因人注意的是SUN ONE(以前的iPlanet)、IIS和BroadVision服務(wù)器。然而,Java更為強(qiáng)大靈活、可靠且可移植。</p>
78、;<p> JavaScript也可以用在服務(wù)器端,最因人注意的是SUN ONE(以前的iPlanet)、IIS和BroadVision服務(wù)器。然而,Java更為強(qiáng)大靈活、可靠且可移植。</p><p> JSP六種內(nèi)置對(duì)象:</p><p> Request,response,out,session,application,config,pagecontext,pag
79、e,exception。</p><p> 一. request對(duì)象:</p><p> 該對(duì)象封裝了用戶提交的信息,通過調(diào)用該對(duì)象相應(yīng)的方法可以獲取封裝的信息,即使用該對(duì)象可以獲取用戶提交信息。</p><p> 二. response對(duì)象:</p><p> 對(duì)客戶的請(qǐng)求做出動(dòng)態(tài)的響應(yīng),向客戶端發(fā)送數(shù)據(jù)。</p>&
80、lt;p> 三. session對(duì)象</p><p> 1. 什么是session:session對(duì)象是一個(gè)JSP內(nèi)置對(duì)象,它在第一個(gè)JSP頁面被裝載時(shí)自動(dòng)創(chuàng)建,完成會(huì)話期管理。</p><p> 從一個(gè)客戶打開瀏覽器并連接到服務(wù)器開始,到客戶關(guān)閉瀏覽器離開這個(gè)服務(wù)器結(jié)束,被稱為一個(gè)會(huì)話。當(dāng)一個(gè)客戶訪問一個(gè)服務(wù)器時(shí),可能會(huì)在這個(gè)服務(wù)器的幾個(gè)頁面之間反復(fù)連接,反復(fù)刷新一個(gè)頁面,服
81、務(wù)器應(yīng)當(dāng)通過某種辦法知道這是同一個(gè)客戶,這就需要session對(duì)象。</p><p> 2. session對(duì)象的ID:當(dāng)一個(gè)客戶首次訪問服務(wù)器上的一個(gè)JSP頁面時(shí),JSP引擎產(chǎn)生一個(gè)session對(duì)象,同時(shí)分配一個(gè)String類型的ID號(hào),JSP引擎同時(shí)將這個(gè)ID號(hào)發(fā)送到客戶端,存放在Cookie中,這樣session對(duì)象和客戶之間就建立了一一對(duì)應(yīng)的關(guān)系。當(dāng)客戶再訪問連接該服務(wù)器的其他頁面時(shí),不再分配給客戶新
82、的session對(duì)象,直到客戶關(guān)閉瀏覽器后,服務(wù)器端該客戶的session對(duì)象才取消,并且和客戶的會(huì)話對(duì)應(yīng)關(guān)系消失。當(dāng)客戶重新打開瀏覽器再連接到該服務(wù)器時(shí),服務(wù)器為該客戶再創(chuàng)建一個(gè)新的session對(duì)象。</p><p> 四. aplication對(duì)象</p><p> 1. 什么是application:</p><p> 服務(wù)器啟動(dòng)后就產(chǎn)生了這個(gè)appl
83、ication對(duì)象,當(dāng)客戶再所訪問的網(wǎng)站的各個(gè)頁面之間瀏覽時(shí),這個(gè)application對(duì)象都是同一個(gè),直到服務(wù)器關(guān)閉。但是與session不同的是,所有客戶的application對(duì)象都是同一個(gè),即所有客戶共享這個(gè)內(nèi)置的application對(duì)象。</p><p> 2. application對(duì)象常用方法:</p><p> (1) public void setAttribute
84、(String key,Object obj):將參數(shù)Object指定的對(duì)象obj添加到application對(duì)象中,并為添加的對(duì)象指定一個(gè)索引關(guān)鍵字。</p><p> (2) public Object getAttribute(String key): 獲取application對(duì)象中含有關(guān)鍵字的對(duì)象。</p><p><b> 五. out對(duì)象</b>&l
85、t;/p><p> out對(duì)象是一個(gè)輸出流,用來向客戶端輸出數(shù)據(jù)。out對(duì)象用于各種數(shù)據(jù)的輸出。</p><p><b> 六. Cookie</b></p><p> 1. 什么是Cookie:</p><p> Cookie是Web服務(wù)器保存在用戶硬盤上的一段文本。Cookie允許一個(gè)Web站點(diǎn)在用戶的電腦上保存
86、信息并且隨后再取回它。</p><p> 舉例來說,一個(gè)Web站點(diǎn)可能會(huì)為每一個(gè)訪問者產(chǎn)生一個(gè)唯一的ID,然后以Cookie文件的形式保存在每個(gè)用戶的機(jī)器上。 </p><p> 如果您使用IE瀏覽器訪問Web,您會(huì)看到所有保存在您的硬盤上的Cookie。它們最常存放的地方是:c:\windows\cookies(在Window2000中則是C:\Documents and Setti
87、ngs\您的用戶名\Cookies )Cookie是以“關(guān)鍵字key=值value“的格式來保存紀(jì)錄的.</p><p> 2. 創(chuàng)建一個(gè)Cookie對(duì)象,調(diào)用Cookie對(duì)象的構(gòu)造函數(shù)可以創(chuàng)建Cookie。Cookie對(duì)象的構(gòu)造函數(shù)有兩個(gè)字符串參數(shù):Cookie名字和Cookie值。</p><p> Cookie c=new Cookie(“username”,”john”);&l
88、t;/p><p> 3. JSP中如果要將封裝好的Cookie對(duì)象傳送到客戶端,使用response的addCookie()方法。</p><p> 格式:response.addCookie(c)</p><p> 4. 讀取保存到客戶端的Cookie,使用request對(duì)象的getCookies()方法,執(zhí)行時(shí)將所有客戶端傳來的Cookie對(duì)象以數(shù)組的形式排列
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- jsp外文翻譯
- 外文翻譯---jsp簡介
- jsp 技術(shù)外文翻譯
- jsp技術(shù)外文翻譯
- 外文翻譯---jsp簡介
- jsp 外文翻譯--jsp及其web技術(shù)
- 外文翻譯---java技術(shù)及ssh框架和jsp技術(shù)的介紹
- jsp應(yīng)用框架外文翻譯
- jsp 應(yīng)用框架-外文翻譯
- jsp 應(yīng)用框架外文翻譯
- 外文翻譯----jsp應(yīng)用框架
- 外文翻譯jsp 應(yīng)用框架
- jsp畢業(yè)設(shè)計(jì)外文翻譯--jsp 應(yīng)用框架
- jsp外文翻譯--jsp技術(shù)概述與應(yīng)用框架
- jsp技術(shù)概述外文翻譯
- jsp技術(shù)網(wǎng)站設(shè)計(jì)外文翻譯
- jsp 應(yīng)用框架-外文及翻譯
- 外文翻譯--jsp及其web技術(shù)
- 外文翻譯--jsp及其web技術(shù)
- java介紹外文翻譯
評(píng)論
0/150
提交評(píng)論