版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、<p> THE TECHNIQUE DEVELOPMENT HISTORY OF JSP</p><p> By:Kathy Sierra and Bert Bates</p><p> Source: Servlet&JSP</p><p> The Java Server Pages( JSP) is a kind of accord
2、ing to web of the script plait distance technique, similar carries the script language of Java in the server of the Netscape company of server- side JavaScript( SSJS) and the Active Server Pages(ASP) of the Microsoft. JS
3、P compares the SSJS and ASP to have better can expand sex, and it is no more exclusive than any factory or some one particular server of Web. Though the norm of JSP is to be draw up by the Sun company of, any factory can
4、 carry out th</p><p> The After Sun release the JSP( the Java Server Pages) formally, the this kind of new Web application development technique very quickly caused the people's concern. JSP provided a
5、 special development environment for the Web application that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, IIS4.0 on the market at inside of 85% se
6、rver product.</p><p> This chapter will introduce the related knowledge of JSP and Databases, and JavaBean related contents, is all certainly rougher introduction among them basic contents, say perhaps to i
7、s a Guide only, if the reader needs the more detailed information, pleasing the book of consult the homologous JSP.</p><p> 1.1 GENERALIZE</p><p> The JSP(Java Server Pages) is from the compan
8、y of Sun Microsystems initiate, the many companies the participate to the build up the together of the a kind the of dynamic the state web the page technique standard, the it have the it in the construction the of the dy
9、namic state the web page the strong but the do not the especially of the function. JSP and the technique of ASP of the Microsoft is very alike. Both all provide the ability that mixes with a certain procedure code and is
10、 explain by the</p><p> JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean t
11、hat servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can
12、 do on a particular computer platform in the Java programming language you could also do in assemb</p><p> JSP provides the following benefits over servlets alone:</p><p> ? It is easier to wr
13、ite and maintain the HTML. Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax.</p><p> ? You can use standard Web-site development tools. Even HTML tools t
14、hat know nothing about JSP can be used because they simply ignore the JSP tags.</p><p> ? You can divide up your development team. The Java programmers can work on the dynamic code. The Web developers can c
15、oncentrate on the presentation layer. On large projects, this division is very important. Depending on the size of your team and the complexity of your project, you can enforce a weaker or stronger separation between the
16、 static HTML and the dynamic content.</p><p> Now, this discussion is not to say that you should stop using servlets and use only JSP instead. By no means. Almost all projects will use both. For some reques
17、ts in your project, you will use servlets. For others, you will use JSP. For still others, you will combine them with the MVC architecture . You want the appropriate tool for the job, and servlets, by themselves, do not
18、complete your toolkit.</p><p> 1.2 SOURCE OF JSP</p><p> The technique of JSP of the company of Sun, making the page of Web develop the personnel can use the HTML perhaps marking of XML to de
19、sign to turn the end page with format. Use the perhaps small script future life of marking of JSP becomes the dynamic state on the page contents.( the contents changes according to the claim of)</p><p> The
20、 Java Servlet is a technical foundation of JSP, and the large Web applies the development of the procedure to need the Java Servlet to match with with the JSP and then can complete, this name of Servlet comes from the Ap
21、plet, the local translation method of now is a lot of, this book in order not to misconstruction, decide the direct adoption Servlet but don't do any translation, if reader would like to, can call it as" small s
22、ervice procedure". The Servlet is similar to traditional CGI, ISAP</p><p> But the Java Servlet also is not to has no weakness, similar to traditional CGI, ISAPI, the NSAPI method, the Java Servlet is
23、to make use of to output the HTML language sentence to carry out the dynamic state web page of, if develop the whole website with the Java Servlet, the integration process of the dynamic state part and the static state p
24、age is an evil-foreboding dream simply. For solving this kind of weakness of the Java Servlet, the SUN released the JSP.</p><p> A number of years ago, Marty was invited to attend a small 20-person industry
25、 roundtable discussion on software technology. Sitting in the seat next to Marty was James Gosling, inventor of the Java programming language. Sitting several seats away was a high-level manager from a very large softwar
26、e company in Redmond, Washington. During the discussion, the moderator brought up the subject of Jini, which at that time was a new Java technology. The moderator asked the manager what he thought of it,</p><p
27、> Now, the grievance that Gosling was airing was that he felt that this company would take technology from other companies and suborn it for their own purposes. But guess what? The shoe is on the other foot here. The
28、 Java community did not invent the idea of designing pages as a mixture of static HTML and dynamic code marked with special tags. For example, Cold Fusion did it years earlier. Even ASP (a product from the very software
29、company of the aforementioned manager) popularized this approach b</p><p> The JSP is an establishment at the model of Java servlets on of the expression layer technique, it makes the plait write the HTML t
30、o become more simple.Be like the SSJS, it also allows you carry the static state HTML contents and servers the script mix to put together the born dynamic state exportation. JSP the script language that the Java is the t
31、acit approval, however, be like the ASP and can use other languages( such as JavaScript and VBScript), the norm of JSP also allows to use other langu</p><p> 1.3JSP CHARACTERISTICS</p><p> Is
32、a service according to the script language in some one language of the statures system this kind of discuss, the JSP should be see make is a kind of script language. However, be a kind of script language, the JSP seemed
33、to be too strong again, almost can use all Javas in the JSP.</p><p> Be a kind of according to text originally of, take manifestation as the central development technique, the JSP provided all advantages of
34、 the Java Servlet, and, when combine with a JavaBeans together, providing a kind of make contents and manifestation that simple way that logic separate. Separate the contents and advantage of logical manifestations is, t
35、he personnel who renews the page external appearance need not know the code of Java, and renew the JavaBeans personnel also need not be design </p><p> Generally speaking, in actual engine of JSP, the page
36、of JSP is the edit and translate type while carry out, not explain the type of. Explain the dynamic state web page development tool of the type, such as ASP, PHP3 etc., because speed etc. reason, have already can't
37、satisfy current the large electronic commerce needs appliedly, traditional development techniques are all at to edit and translate the executive way change, such as the ASP → ASP+;PHP3 → PHP4.</p><p> In th
38、e JSP norm book, did not request the procedure in the JSP code part( be called the Scriptlet) and must write with the Java definitely. Actually, have some engines of JSP are adoptive other script languages such as the EM
39、AC- Script, etc., but actually this a few script languages also are to set up on the Java, edit and translate for the Servlet to carry out of. Write according to the norm of JSP, have no Scriptlet of relation with Java a
40、lso is can of, however, mainly lie in the ability and J</p><p> 1.4JSP MECHANISM</p><p> To comprehend the JSP how unite the technical advantage that above various speak of, come to carry out
41、various result easily, the customer must understand the differentiation of" the module develops for the web page of the center" and" the page develops for the web page of the center" first. </p>
42、<p> The SSJS and ASP are all in several year ago to release, the network of that time is still very young, no one knows to still have in addition to making all business, datas and the expression logic enter the
43、original web page entirely heap what better solve the method. This kind of model that take page as the center studies and gets the very fast development easily. However, along with change of time, the people know that th
44、is kind of method is unwell in set up large, the Web that can upgrade app</p><p> At the same time, the people always at look for the better method of build up the Web application procedure, the modul
45、e spreads in customer's machine/ server the realm. JavaBeans and ActiveX were published the company to expand to apply the procedure developer for Java and Windows to use to come to develop the complicated procedur
46、e quickly by" the fast application procedure development"( RAD) tool. These techniques make the expert in the some realm be able to write the module for the per</p><p> Be a kind of take module as
47、 the central development terrace, the JSP appeared. It with the JavaBeans and Enterprise JavaBeans( EJB) module includes the model of the business and the data logic for foundation, provide a great deal of label and a sc
48、ript terraces to use to come to show in the HTML page from the contents of JavaBeans creation or send a present in return. Because of the property that regards the module as the center of the JSP, it can drive Java and n
49、ot the developer of Java uses equ</p><p> See now how JSP is handle claim of HTTP. In basic claim model, a claim directly was send to JSP page in. The code of JSP controls to carry on hour of the logic proc
50、essing and module of JavaBeanses' hand over with each other, and the manifestation result in dynamic state bornly, mixing with the HTML page of the static state HTML code. The Beans can be JavaBeans or module of EJBs
51、. Moreover, the more complicated claim model can see make from is request other JSP pages of the page call sign or Java </p><p> The engine of JSP wants to chase the code of Java that the label of JSP, code
52、 of Java in the JSP page even all converts into the big piece together with the static state HTML contents actually. These codes piece was organized the Java Servlet that customer can not see to go to by the engine of JS
53、P, then the Servlet edits and translate them automatically byte code of Java.</p><p> Thus, the visitant that is the website requests a JSP page, under the condition of it is not knowing, an already born, t
54、he Servlet actual full general that prepared to edit and translate completes all works, very concealment but again and efficiently. The Servlet is to edit and translate of, so the code of JSP in the web page does not nee
55、d when the every time requests that page is explain. The engine of JSP need to be edit and translate after Servlet the code end is modify only once, then this S</p><p> Compared with the traditional CGI, th
56、e JSP has the equal advantage. First, on the speed, the traditional procedure of CGI needs to use the standard importation of the system to output the equipments to carry out the dynamic state web page born, but the JSP
57、is direct is mutually the connection with server. And say for the CGI, each interview needs to add to add a progress to handle, the progress build up and destroy by burning constantly and will be a not small burden for c
58、alculator of be the ser</p><p> JSP的技術(shù)發(fā)展歷史</p><p> 作者: Kathy Sierra and Bert Bates</p><p> 來源: Servlet&JSP</p><p> Java Server Pages(JSP)是一種基于web的腳本編程技術(shù),類似于網(wǎng)景公司
59、的服務(wù)器端Java腳本語(yǔ)言—— server-side JavaScript(SSJS)和微軟的Active Server Pages(ASP)。與SSJS和ASP相比,JSP具有更好的可擴(kuò)展性,并且它不專屬于任何一家廠商或某一特定的Web服務(wù)器。盡管JSP規(guī)范是由Sun公司制定的,但任何廠商都可以在自己的系統(tǒng)上實(shí)現(xiàn)JSP。 </p><p> 在Sun正式發(fā)布JSP(Java Server Pages)之后,
60、這種新的Web應(yīng)用開發(fā)技術(shù)很快引起了人們的關(guān)注。JSP為創(chuàng)建高度動(dòng)態(tài)的Web應(yīng)用提供了一個(gè)獨(dú)特的開發(fā)環(huán)境。按照Sun的說法,JSP能夠適應(yīng)市場(chǎng)上包括Apache WebServer、IIS4.0在內(nèi)的85%的服務(wù)器產(chǎn)品。</p><p> 本文將介紹JSP相關(guān)的知識(shí),以及JavaBean的相關(guān)內(nèi)容,當(dāng)然都是比較粗略的介紹其中的基本內(nèi)容,僅僅起到拋磚引玉的作用,如果讀者需要更詳細(xì)的信息,請(qǐng)參考相應(yīng)的JSP的書籍。
61、</p><p><b> 1.1 概述</b></p><p> JSP(Java Server Pages)是由Sun Microsystems公司倡導(dǎo)、許多公司參與一起建立的一種動(dòng)態(tài)網(wǎng)頁(yè)技術(shù)標(biāo)準(zhǔn),其在動(dòng)態(tài)網(wǎng)頁(yè)的建設(shè)中有其強(qiáng)大而特別的功能。JSP與Microsoft的ASP技術(shù)非常相似。兩者都提供在HTML代碼中混合某種程序代碼、由語(yǔ)言引擎解釋執(zhí)行程序代碼的能
62、力。下面我們簡(jiǎn)單的對(duì)它進(jìn)行介紹。</p><p> JSP頁(yè)面最終會(huì)轉(zhuǎn)換成servlet。因而,從根本上,JSP頁(yè)面能夠執(zhí)行的任何任務(wù)都可以用servlet來完成。然而,這種底層的等同性并不意味著servlet和JSP頁(yè)面對(duì)于所有的情況都等同適用。問題不在于技術(shù)的能力,而是二者在便利性、生產(chǎn)率和可維護(hù)性上的不同。畢竟,在特定平臺(tái)上能夠用Java編程語(yǔ)言完成的事情,同樣可以用匯編語(yǔ)言來完成,但是選擇哪種語(yǔ)言依舊十
63、分重要。</p><p> 和單獨(dú)使用servlet相比,JSP提供下述好處:</p><p> JSP中HTML的編寫與維護(hù)更為簡(jiǎn)單。JSP中可以使用常規(guī)的HTML:沒有額外的反斜杠,沒有額外的雙引號(hào),也沒有暗含的Java語(yǔ)法。</p><p> 能夠使用標(biāo)準(zhǔn)的網(wǎng)站開發(fā)工具。即使是那些對(duì)JSP一無所知的HTML工具,我們也可以使用,因?yàn)樗鼈儠?huì)忽略JSP標(biāo)簽(
64、JSP tags)。</p><p> 可以對(duì)開發(fā)團(tuán)隊(duì)進(jìn)行劃分。Java程序員可以致力于動(dòng)態(tài)代碼。Web開發(fā)人員可以將經(jīng)理集中在表示層(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)。</p><p&
65、gt; 此處的討論并不是說人們應(yīng)該放棄使用servlet而僅僅使用JSP。事實(shí)上,幾乎所有的項(xiàng)目都會(huì)同時(shí)用到這兩種技術(shù)。在某些項(xiàng)目中,更適宜選用servlet,而針對(duì)項(xiàng)目中的某些請(qǐng)求,我們可能會(huì)在MVC構(gòu)架下組合使用這兩項(xiàng)技術(shù)。我們總是希望用適當(dāng)?shù)墓ぞ咄瓿上鄬?duì)應(yīng)的工作,僅僅是servlet并不一定能夠勝任所有工作。</p><p> 1.2 JSP的由來</p><p> Sun公司
66、的JSP技術(shù),使Web頁(yè)面開發(fā)人員可以使用HTML或者XML標(biāo)識(shí)來設(shè)計(jì)和格式化最終頁(yè)面。使用JSP標(biāo)識(shí)或者小腳本來生成頁(yè)面上的動(dòng)態(tài)內(nèi)容(內(nèi)容是根據(jù)請(qǐng)求來變化的)。</p><p> Java Servlet是JSP技術(shù)的基礎(chǔ),而且大型的Web應(yīng)用程序的開發(fā)需要Java Servlet和JSP配合才能完成,Servlet這個(gè)名稱源于Applet,現(xiàn)在國(guó)內(nèi)的翻譯方式很多,本書為了避免誤會(huì),決定直接采用Servlet
67、而不做任何翻譯,讀者如果愿意,可以稱之為“小服務(wù)程序”。Servlet其實(shí)和傳統(tǒng)的CGI、ISAPI、NSAPI等Web程序開發(fā)工具的作用是相似的,在使用Java Servlet以后,用戶不必再使用效率低下的CGI方式,也不必使用只能在某個(gè)固定Web服務(wù)器平臺(tái)運(yùn)行的API方式來動(dòng)態(tài)生成Web頁(yè)面。許多Web服務(wù)器都支持Servlet,即使不直接支持Servlet的Web服務(wù)器也可以通過附加的應(yīng)用服務(wù)器和模塊來支持Servlet。得益于J
68、ava的跨平臺(tái)的特性,Servlet也是平臺(tái)無關(guān)的,實(shí)際上,只要符合Java Servlet規(guī)范,Servlet是完全與平臺(tái)無關(guān)且是與Web服務(wù)器無關(guān)的。由于Java Servlet內(nèi)部是以線程方式提供服務(wù),不必對(duì)于每個(gè)請(qǐng)求都啟動(dòng)一個(gè)進(jìn)程,并且利用多線程機(jī)制可以同時(shí)為多個(gè)請(qǐng)求服務(wù),因此Java Servlet效率非常高。</p><p> 但Java Servlet也不是沒有缺點(diǎn),和傳統(tǒng)的CGI、ISAPI、N
69、SAPI方式相同,Java Servlet是利用輸出HTML語(yǔ)句來實(shí)現(xiàn)動(dòng)態(tài)網(wǎng)頁(yè)的,如果用Java Servlet來開發(fā)整個(gè)網(wǎng)站,動(dòng)態(tài)部分和靜態(tài)頁(yè)面的整合過程會(huì)非常難以實(shí)現(xiàn)。為了解決Java Servlet的這種缺點(diǎn),SUN推出了JSP。</p><p> 許多年前,Marty受到邀請(qǐng),參加一個(gè)有關(guān)軟件技術(shù)的小型研討會(huì).坐在Marty旁邊的人是James Gosling--- Java編程語(yǔ)言的發(fā)明者。隔幾個(gè)位置
70、,是來自華盛頓一家大型軟件公司的高級(jí)經(jīng)理。在討論過程中,研討會(huì)的主席提出了Jini的議題,這在當(dāng)時(shí)是一項(xiàng)新的Java技術(shù)。主席向該經(jīng)理詢問他的想法.他回答說,雖然現(xiàn)在言之過早,但這看起來會(huì)是非常有前途的一項(xiàng)技術(shù)。他們會(huì)持續(xù)關(guān)注這項(xiàng)技術(shù),如果這項(xiàng)技術(shù)變得流行起來,他們會(huì)遵循公司的“接受并擴(kuò)充(embrace and extend)”的策略.此時(shí), Gosling隨意地插話說“你的意思其實(shí)就是不接受且不擴(kuò)充(disgrace and dis
71、tend)?!?lt;/p><p> 在此, Gosling的抱怨顯示出,他感到這個(gè)公司會(huì)從其他公司那里拿走技術(shù),用于他們自己的目的.出人意料的是,形勢(shì)已經(jīng)完全不同。Java團(tuán)隊(duì)并沒有發(fā)明這一思想----將頁(yè)面設(shè)計(jì)成由靜態(tài)HTML和用特殊標(biāo)簽標(biāo)記的動(dòng)態(tài)代碼混合組成.。ColdFusion多年前就已經(jīng)這樣做了。甚至ASP(來自于前述經(jīng)理所在公司的一項(xiàng)產(chǎn)品)都在JSP出現(xiàn)之前推廣了這種方式。實(shí)際上,JSP不只采用了這種
72、通用概念,它甚至使用許多和ASP相同的特殊標(biāo)簽。</p><p> JSP是建立在Java servlets模型之上的表達(dá)層技術(shù),它使編寫HTML變得更簡(jiǎn)單。像SSJS一樣,它也允許你將靜態(tài)HTML內(nèi)容與服務(wù)器端腳本混合起來生成動(dòng)態(tài)輸出。JSP把Java作為默認(rèn)的腳本語(yǔ)言,然而,就像ASP可以使用其他語(yǔ)言(如JavaScript和VBScript)一樣,JSP規(guī)范也允許使用其他語(yǔ)言。</p>&l
73、t;p> 1.3 JSP的特點(diǎn)</p><p> 按照腳本語(yǔ)言是服務(wù)于某一個(gè)子系統(tǒng)的語(yǔ)言這種論述,JSP應(yīng)當(dāng)被看作是一種腳本語(yǔ)言。然而,作為一種腳本語(yǔ)言,JSP又顯得過于強(qiáng)大了,在JSP中幾乎可以使用全部的Java類。</p><p> 作為一種基于文本的、以顯示為中心的開發(fā)技術(shù),JSP提供了Java Servlet的所有好處,并且,當(dāng)與一個(gè)JavaBeans類結(jié)合在一起時(shí),J
74、SP提供了一種使內(nèi)容和顯示邏輯分開的簡(jiǎn)單方式。分開內(nèi)容和顯示邏輯的好處是,更新頁(yè)面外觀的人員不必懂得Java代碼,而更新JavaBeans類的人員也不必是設(shè)計(jì)網(wǎng)頁(yè)的行家里手,就可以用帶JavaBeans類的JSP頁(yè)面來定義Web模板,以建立一個(gè)由具有相似的外觀的頁(yè)面組成的網(wǎng)站。JavaBeans類完成數(shù)據(jù)提供,這樣在模板中就沒有Java代碼,這意味著這些模板可以由一個(gè)HTML編寫人員來維護(hù)。當(dāng)然,也可以利用Java Servlet來控制
75、網(wǎng)站的邏輯,通過Java Servlet調(diào)用JSP文件的方式來將網(wǎng)站的邏輯和內(nèi)容分離。</p><p> 一般來說,在實(shí)際的JSP引擎中,JSP頁(yè)面在執(zhí)行時(shí)是編譯式,而不是解釋式的。解釋式的動(dòng)態(tài)網(wǎng)頁(yè)開發(fā)工具如ASP、PHP3等由于速度等原因已經(jīng)滿足不了當(dāng)前大型電子商務(wù)應(yīng)用的需要了,傳統(tǒng)的開發(fā)技術(shù)都在向編譯執(zhí)行的方式改變,如ASP→ASP+;PHP3→PHP4。</p><p> 在JS
76、P規(guī)范書中,并沒有明確要求JSP中的程序代碼部分(稱為Scriptlet)一定要用Java來寫。實(shí)際上,有一些JSP引擎就是采用的其他腳本語(yǔ)言,如EMAC-Script、WebL等,但實(shí)際上這幾種腳本語(yǔ)言也是構(gòu)建在Java上面,編譯為Servlet來實(shí)現(xiàn)的。按照J(rèn)SP規(guī)范書寫,和Java沒有任何關(guān)系的Scriptlet也是可以的,不過,由于JSP的強(qiáng)大功能主要在于能和JavaBeans、Enterprise JavaBeans共同運(yùn)轉(zhuǎn),
77、所以即使是Scriptlet部分不使用Java,編譯成的執(zhí)行代碼也應(yīng)該是與Java相關(guān)的。</p><p> 1.4 JSP的機(jī)制</p><p> 要理解JSP怎樣聯(lián)合以上各種所提到的技術(shù)的優(yōu)點(diǎn),從而輕而易舉地實(shí)現(xiàn)各種效果,用戶必須首先了解“組件為中心的網(wǎng)頁(yè)開發(fā)”和“頁(yè)面為中心的網(wǎng)頁(yè)開發(fā)”的區(qū)別。 </p><p> SSJS和ASP都是在幾年前推出的,那時(shí)
78、網(wǎng)絡(luò)還很年輕,沒有人知道除了把所有的商務(wù)、數(shù)據(jù)和表達(dá)邏輯統(tǒng)統(tǒng)堆進(jìn)原始網(wǎng)頁(yè)中之外還有什么更好的解決方法。這種以頁(yè)面為中心的模型容易學(xué)習(xí)并且得到相當(dāng)快速的發(fā)展。然而,隨著時(shí)間的推移,人們認(rèn)識(shí)到這種方法不適于構(gòu)建大型的、可升級(jí)的Web應(yīng)用程序。在腳本環(huán)境中書寫的表達(dá)邏輯被鎖在頁(yè)面內(nèi),只有通過剪切和粘貼才能被重用。表達(dá)邏輯通常和商務(wù)及數(shù)據(jù)邏輯混在一起,這使得當(dāng)程序員試圖改變一個(gè)應(yīng)用程序的外觀而不想破壞與之緊密結(jié)合的商務(wù)邏輯時(shí),應(yīng)用程序的維護(hù)就變
79、得十分艱難。其事實(shí)上,企業(yè)中可重用組件的應(yīng)用早已經(jīng)很成熟,沒有人愿意為它們的應(yīng)用程序重寫那些邏輯。HTML和圖形設(shè)計(jì)師把它們的設(shè)計(jì)的實(shí)施工作交給了Web編寫者,使他們不得不加倍工作—— 常常是手工編寫,因?yàn)闆]有合適的工具可以把服務(wù)器端腳本與HTML內(nèi)容結(jié)合起來。簡(jiǎn)而言之,隨著Web應(yīng)用程序的復(fù)雜性不斷提升,以頁(yè)面為中心的開發(fā)方式的局限性變得明顯起來。 </p><p> 與此同時(shí),人們一直在尋找建立Web應(yīng)用程
80、序的更好方法,組件在客戶機(jī)/服務(wù)器領(lǐng)域流行起來。JavaBeans和ActiveX被“快速應(yīng)用程序開發(fā)”(RAD)工具發(fā)行商推廣給Java和Windows應(yīng)用程序開發(fā)者用來快速開發(fā)復(fù)雜的程序。這些技術(shù)使某領(lǐng)域內(nèi)的專家可以為本領(lǐng)域內(nèi)的垂直應(yīng)用編寫組件,而開發(fā)者可以直接拿來使用而不必掌握這一領(lǐng)域的專門技術(shù)。</p><p> 作為一種以組件為中心的開發(fā)平臺(tái),JSP出現(xiàn)了。它以JavaBeans和Enterprise
81、 JavaBeans(EJB)組件包含商務(wù)和數(shù)據(jù)邏輯的模型為基礎(chǔ),提供大量標(biāo)簽和一個(gè)腳本平臺(tái)用來在HTML頁(yè)中顯示由JavaBeans產(chǎn)生或回送的內(nèi)容。由于JSP的以組件為中心的性質(zhì),它可以被Java和非Java開發(fā)者同樣使用。非Java開發(fā)者可以通過JSP的標(biāo)簽(Tags)來使用高級(jí)Java開發(fā)者創(chuàng)建的JavaBeans。Java開發(fā)者不僅可以創(chuàng)建和使用JavaBeans,還能在JSP頁(yè)中使用Java語(yǔ)言來更精密地控制基于底層Java
82、Beans的表達(dá)邏輯。 </p><p> 現(xiàn)在來看看JSP是如何處理HTTP請(qǐng)求的。在基本請(qǐng)求模型中,一個(gè)請(qǐng)求直接被送到JSP頁(yè)中。JSP代碼控制著進(jìn)行邏輯處理時(shí)與JavaBeans組件的交互,并在動(dòng)態(tài)生成的、混合了靜態(tài)HTML代碼的HTML頁(yè)中顯示結(jié)果。Beans 可以是JavaBeans 或EJB組件。另外,更加復(fù)雜的請(qǐng)求模型可看作從被請(qǐng)求頁(yè)呼叫其他JSP頁(yè)或Java Servlets。</p>
83、;<p> JSP引擎實(shí)際上要把JSP標(biāo)簽、JSP頁(yè)中的Java代碼甚至連同靜態(tài)HTML內(nèi)容都轉(zhuǎn)換為大塊的Java代碼。這些代碼塊被JSP引擎組織到用戶看不到的Java Servlet中去,然后Servlet自動(dòng)把它們編譯成Java字節(jié)碼。這樣,當(dāng)網(wǎng)站的訪問者請(qǐng)求一個(gè)JSP頁(yè)時(shí),在它不知道的情況下,一個(gè)已經(jīng)生成的、預(yù)編譯過的Servlet實(shí)際上將完成所有的工作,非常隱蔽而又高效。因?yàn)镾ervlet是編譯過的,所以網(wǎng)頁(yè)中的
84、JSP代碼不需要在每次請(qǐng)求該頁(yè)時(shí)被解釋一遍。JSP引擎只需在Servlet代碼最后被修改后編譯一次,然后這個(gè)編譯過的Servlet就可以被執(zhí)行了。由于是JSP引擎自動(dòng)生成并編譯Servlet,不用程序員動(dòng)手編譯代碼,所以JSP能帶給你高效的性能和快速開發(fā)所需的靈活性。</p><p> 和傳統(tǒng)的CGI相比較,JSP有相當(dāng)?shù)膬?yōu)勢(shì)。首先,在速度上,傳統(tǒng)的CGI程序需要使用系統(tǒng)的標(biāo)準(zhǔn)輸入輸出設(shè)備來實(shí)現(xiàn)動(dòng)態(tài)網(wǎng)頁(yè)的生成,
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝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ù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫(kù)僅提供信息存儲(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è)設(shè)計(jì)(論文)外文翻譯--jsp技術(shù)發(fā)展史
- jsp的技術(shù)發(fā)展歷史畢業(yè)論文外文翻譯
- 計(jì)算機(jī)專業(yè)畢業(yè)外文翻譯--jsp技術(shù)概述
- 外文翻譯--jsp技術(shù)發(fā)展史
- jsp技術(shù)發(fā)展史外文翻譯
- jsp中英文翻譯--- jsp的技術(shù)發(fā)展歷史
- 計(jì)算機(jī)外文翻譯---jsp應(yīng)用框架
- 計(jì)算機(jī)外文翻譯---jsp 應(yīng)用框架
- 外文翻譯--JSP技術(shù)發(fā)展史.doc
- 外文翻譯--JSP技術(shù)發(fā)展史.doc
- 計(jì)算機(jī)外文翻譯--- xml與jsp聯(lián)手
- 計(jì)算機(jī)專業(yè)畢業(yè)外文翻譯--jsp簡(jiǎn)介
- 計(jì)算機(jī)專業(yè)外文翻譯---jsp 應(yīng)用框架
- 計(jì)算機(jī)系外文翻譯---歷史的計(jì)算
- 計(jì)算機(jī)系外文翻譯--歷史的計(jì)算
- 計(jì)算機(jī)外文翻譯--javabean 的發(fā)展
- 淺議計(jì)算機(jī)軟件技術(shù)發(fā)展
- 計(jì)算機(jī)專業(yè)畢業(yè)外文翻譯--internet的歷史
- 計(jì)算機(jī)專業(yè)外文翻譯--計(jì)算機(jī)
- 計(jì)算機(jī)的發(fā)展歷史
評(píng)論
0/150
提交評(píng)論