關(guān)于jsp的介紹生外文翻譯_第1頁
關(guān)于jsp的介紹生外文翻譯_第2頁
關(guān)于jsp的介紹生外文翻譯_第3頁
關(guān)于jsp的介紹生外文翻譯_第4頁
關(guān)于jsp的介紹生外文翻譯_第5頁
已閱讀5頁,還剩9頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、XX理工大學(xué)XX學(xué)院畢業(yè)設(shè)計(論文)外文資料翻譯系:_計算機系_專 業(yè): _計算機科學(xué)與技術(shù)_姓 名: _XXX _學(xué) 號: _080601165_夕卜文出處: Anon .The In troductio n Of JSP EB/OL.(用外文寫)(2009-01-13)2011 -12-20.http:/nibiye. com/fy/wwfy/jsjw/2009/0113/1033.html.附 件:1.外文資料翻譯譯文;2.外文原文。指導(dǎo)教師評語:該譯文比較通順,專業(yè)詞匯的使用也比較準確,較好地反 映了原文的本意,說明該生較好地理解了原文的意思,表明該 同學(xué)具備一定的閱讀外文資料的能力。

2、簽名:年 月 日注:請將該封面與附件裝訂成冊附件1:外文資料翻譯譯文關(guān)于JSP的介紹Java2企業(yè)版(J2EE)已經(jīng)把建立一個網(wǎng)上的亂中有律任務(wù)的存在現(xiàn)象進行了有 效的改造,就是開發(fā)人員能使用Java有效創(chuàng)造多層次的服務(wù)器端應(yīng)用程序。今天, Java企業(yè)應(yīng)用程序編程接口已經(jīng)擴大,包括許多方面:遠程方法調(diào)用與公共對象請 求代理體系結(jié)構(gòu)用來遠程對象的處理,JDBC(Java數(shù)據(jù)庫的連接)的數(shù)據(jù)庫交互, JNDI (Java命名和目錄接口)來訪問命名和目錄服務(wù),為企業(yè)創(chuàng)造了可重復(fù)使用的 JavaBean業(yè)務(wù)組件、JMS(Java信息服務(wù))消息中介軟件,JAXP為XML (可擴展標示 語言)處理和JT

3、A(Java事務(wù)應(yīng)用程序界面)為執(zhí)行一個原子事務(wù)。此外,J2EE也支持 小型服務(wù)程序,極受歡迎的Java語言代替了公共網(wǎng)關(guān)接口腳本。這些技術(shù)的結(jié)合, 可以讓程序員創(chuàng)造分布式業(yè)務(wù)解決方案中的各種任務(wù)。早在在1999年末,Sun Microsystems (美國一家計算機公司)添加了一個新的 精選的元素企業(yè)Java工具:Java動態(tài)服務(wù)器頁面(JSP)。Java動態(tài)服務(wù)器頁面都是建 立在Java的頂部小型服務(wù)器用來增進效率使程序員,甚至是非專業(yè)的程序員,都可 以創(chuàng)建網(wǎng)頁的內(nèi)容。那么什么是Java服務(wù)器頁呢?我們來簡潔明點,Java的動態(tài)服務(wù)器頁面是一個運用科學(xué)技術(shù)發(fā)展的網(wǎng)頁,其 中是包括動態(tài)內(nèi)容的

4、。不像一個HTML頁面,只包含靜態(tài)內(nèi)容,總是保持不變的, 一個JSF頁面中可以改變它的內(nèi)容基于任何數(shù)量的變項,包括用戶的身份,用戶的 瀏覽器類型,用戶信息的提供,或者由用戶選擇信息等等。一個JSF頁面中包含標準標記語言的元素,例如HTML標簽,它也就像是一個正規(guī)的網(wǎng)頁。然而,一個 JSP 動態(tài)服務(wù)器頁面中也含有特殊的JSP元素允許服務(wù)器插入動態(tài)的內(nèi)容在其頁面里。 JSP元素可以被用于各種用途,比如檢索數(shù)據(jù)庫里的信息或注冊用戶信息等等。當(dāng) 一個用戶訪問一個JSP動態(tài)服務(wù)器頁面的時候,服務(wù)器執(zhí)行JSP元素,就會融合靜態(tài) 部分的頁面來組成動態(tài)頁面,并將動態(tài)組成頁面返回到瀏覽器,供用戶瀏覽。JSP定義

5、了大量的標準構(gòu)件,適用于任何的網(wǎng)路式應(yīng)用程序,比如訪問JavaBeans 組件,通過控制頁和信息共享之間,通過在請求,頁面和用戶之間。程序員可以也 將通過實施特定的應(yīng)用JSP動態(tài)服務(wù)器頁語法元素來完成任務(wù),比如訪問數(shù)據(jù)庫執(zhí) 行任務(wù)和訪問企業(yè)JavaBean組件,比如發(fā)送電子郵件和生成HTML到當(dāng)前的特殊應(yīng) 用程序的細節(jié)數(shù)據(jù)。這樣一套通常需要定制的元素被定義為一個質(zhì)量指標有聯(lián)系的 JSP規(guī)范:JSP標準標簽庫(JSTL)的規(guī)格。結(jié)合標準元件和自定義元素允許為建立強 大的網(wǎng)絡(luò)應(yīng)用程序而提供了強有力的保證。那么我們?yōu)槭裁匆褂肑SP呢?在很早期的網(wǎng)絡(luò)開發(fā)的時候,公共網(wǎng)關(guān)接口(CGI)是動態(tài)發(fā)展的網(wǎng)頁

6、內(nèi)容的唯一 的工具。然而, 公共網(wǎng)關(guān)接口這并不是一個非常有效的解決方案。為了滿足所有開發(fā)者的要求,當(dāng)網(wǎng)絡(luò)服務(wù)器必須創(chuàng)建一個新的操作系統(tǒng)的過程中,負荷翻譯和一 個腳本的時候,執(zhí)行了劇本,然后把它們都記錄下來了。這對服務(wù)器來說是非常繁 重繁瑣的,增加了很多不必要的操作和流量。后來眾多的公共網(wǎng)關(guān)接口被代替和改進了,如快速公共網(wǎng)關(guān)接口協(xié)議,Apache服務(wù)器中的mod_per模塊,從NSAPI到美國網(wǎng)景公司,從ISAPI到美國微軟公司, 從Java小型服務(wù)程序到Sun Microsystems公司,這些都在過去的幾年里已經(jīng)形成了。 雖然這些解決方案應(yīng)對措施展現(xiàn)了很好的表現(xiàn)性和可擴展性,但是所有這些技術(shù)

7、遭 受了一個共同的問題:他們都是直接產(chǎn)生嵌入 HTML網(wǎng)頁的程序設(shè)計語言代碼。因 為這一原因就需要創(chuàng)造動態(tài)網(wǎng)頁領(lǐng)域的專門的程序員了。然而Java服務(wù)器頁,就改變了這一切的一切。JSP蘭截問題從另一個方向表明,不是嵌入HTML程序代碼,JSP 而是讓你特別有效成分嵌入HTML網(wǎng)頁,這些給HTML元素元素看起來很相似很相 似,但當(dāng)用戶請求頁面服務(wù)器執(zhí)行時,他們實際上它們都是在幕后構(gòu)件化Javag式來執(zhí)行的。這里有一個非常簡單的JSP頁面,就說明了這一點的內(nèi)容:v% taglib prefix=c url=http:/Java.su %c:when test=$clock.hours Good mo

8、rning! c: when test=$clock.hours Good day! Good eve ning! v/c: otherwise v/c: choose Welcome to our site, ope n 24 hours a day.這一頁根據(jù)一天的時間插入一個不同的消息給用戶:如果當(dāng)?shù)貢r間是12點之前,則給出“早上好!”如果在12點和6點給出“美好的一天!”否則就給出“晚 上好!”當(dāng)一個用戶訪問這一頁,JSP自動化網(wǎng)絡(luò)服務(wù)器用有效的JSP原理執(zhí)行邏輯 回應(yīng),且生成一個頁面送回用戶的瀏覽器。例如,如果現(xiàn)在的時間是下午8 53,從服務(wù)器發(fā)送到瀏覽器的最終頁面看起來像這樣:Go

9、od eve ning! Welcome to our site, ope n 24 hours a day.除了很像超文本標記語言的JSP元素,一個JSP頁面中也含有Javaf弋碼嵌在所謂 的腳本的元素。這一特點已經(jīng)是最早版本 JSP規(guī)范的一種了,它用來起來非常方便 非常簡單而且很有條件邏輯性。通過引入新的 JSP標準標簽庫(JSTL),所以就使得 Javaf弋碼頁是完全沒必要的。此外,太多的代碼嵌入網(wǎng)頁中并不比使用超文本標記 語言元素在一個服務(wù)器端程序好多少,而且通常會導(dǎo)致有一個網(wǎng)絡(luò)應(yīng)用程序請求, 這是很難維護和調(diào)試的。使用合適的人做每一項合適的任務(wù)。當(dāng)我們早些時候,JSP是允許你把標記語

10、言代碼,如HTML,用程序語言代碼來處理用戶輸入,訪問數(shù)據(jù)庫和執(zhí)行其他應(yīng)用 的任務(wù)操作。這種分離發(fā)生的一種方法是通過使用JSP標準和自定義元素,這些元素是實現(xiàn)和應(yīng)用程序代碼一樣標是記兀素在常規(guī)頁網(wǎng)頁中的。另一種方法來分離是結(jié)合JSP和其他J2EE技術(shù)。例如,Java小服務(wù)程序可以處理 輸入后處理,企業(yè)JavaBeans(EJB能夠照顧應(yīng)用的程序的邏輯,和JSF頁面可以提供 用戶界面。這種JSP方法的分離意味著,典型的企業(yè)可以分為兩組人,他們其中有自己的 領(lǐng)域的專業(yè)知識的Javag序員可以一起作為開發(fā)團隊,開發(fā)網(wǎng)站實施應(yīng)用邏輯作為 小服務(wù)程序,商業(yè)應(yīng)用組件技術(shù)和自定義 JSP元素,這就使網(wǎng)頁具體

11、的工藝的作者 使用功能強大的自定義界面元素而就不需要做任何編程。最后整合與企業(yè)Java的編程接口,因為都是建立在Java服務(wù)器網(wǎng)頁上方的Java 應(yīng)用程序界面,JSP擁有所有的強大的企業(yè)Java的應(yīng)用程序接口,這些都包括: ? JDBC( Java數(shù)據(jù)庫的連接)? Remote Method In vocation (RMI) and OMG CORBA support (遠程方法調(diào)用)? JNDI (Java Nami ng and Directory In terface)(命名目錄服務(wù))? En terpriseJavaBea ns (EJB)( JAVA 中的商業(yè)應(yīng)用組件技術(shù))? JM

12、S (Java Message ServiceX Java消 肖息服務(wù))? JTA Java Tran saction API)(事物處理構(gòu)架)? JAXP (Java API for XML Processing)(用于XML文檔處理的使用Java語言編寫的編 程接口)? JavaMail (提供給開發(fā)者處理電子郵件相關(guān)的編程接口)這意味著你可以更加容易地集成 Java服務(wù)器頁面與你現(xiàn)有的Java的企業(yè)所需 要的解決方案。Java servlet模板引擎。一個Java小型服務(wù)程序模板引擎就是另一種技術(shù)表現(xiàn)了, 從加工到分離。當(dāng)小型服務(wù)程序流行起來,沒過多久開發(fā)商意識到這是多么難以維 護的啊,

13、HTML代碼演示部分直接嵌入Java小服務(wù)程序的代碼。結(jié)果就導(dǎo)致了,相 當(dāng)多的所謂的模板引擎已經(jīng)發(fā)展開源產(chǎn)品的幫助獲取小服務(wù)程序中HTML的值。使用模板引擎的目的是,可以使用純代碼元件(servlets)和使用的網(wǎng)頁腳本代碼,這僅僅是表現(xiàn)了部分內(nèi)容。請求被送到一個servlet加工的要求,創(chuàng)造物體,展現(xiàn)了結(jié)果, 并呼吁一個網(wǎng)頁生成的HTML模板將被派到瀏覽器。包含腳本代碼模板描述相似的 選擇更早。腳本語言使用的這些引擎都缺少一點點的強大,然而,由于腳本只限于 讀數(shù)據(jù)對象和生成HTML代碼顯示其存在的價值。所有其他產(chǎn)品和技術(shù)支持的通用 語言(這可以是好的也可以是壞的)被用于包括在業(yè)務(wù)邏輯頁面中。

14、結(jié)合了最重要的特征中發(fā)現(xiàn)的辦法:?JSP既支持腳本語言也支持基于動態(tài)元素的內(nèi)容,并允許程序員開發(fā)自己定義的標簽庫以用來滿足特定應(yīng)用的需要。?JSP頁面可以進行非常有效的服務(wù)器處理和編譯。?JSP頁面可通過Java servlet支持模板引擎以來用于處理servlets結(jié)合商業(yè)邏輯的模 型。此外JSP還有有幾個非常獨特的優(yōu)點,這就使它得以脫穎而出了。?JSP是一個質(zhì)量指標,而不是一個產(chǎn)品。這意味著供應(yīng)商可以根據(jù)不同的要求來實 現(xiàn)不同的方案,從而引導(dǎo)他們走向更好的性能和更好的質(zhì)量。它也會導(dǎo)致一個較不 明顯的優(yōu)勢,就是即當(dāng)許多公司已經(jīng)投入了大量的時間和金錢在技術(shù)上,非??赡?的是這將會在很長一段時間

15、內(nèi),以合理的保證的新版本將會和一個專有的技術(shù)反向 兼容;這并不是一個總是考慮到了的問題。?JSP不可分割的一部分就是J2EE,它為企業(yè)級應(yīng)用提供了一個非常完整的平臺。 這意味著JSP能在其中可以扮演一個最簡單的應(yīng)用程序角色,也可以扮演最復(fù)雜最 苛刻角色。附件 2:外文原文 (復(fù)印件)The Introduction Of JSPThe Java 2 Enterprise Edition (J2EE) has taken the once-chaotic task of building an internet presence and transformed it to the point w

16、here developers can use Java to efficiently create multitier, server-side applications. Today, the Java Enterprise APIs have expanded to encompass a number of areas: RMI and CORBA for remote object handling, JDBC for database interaction, JNDI for accessing naming and directory services, Enterprise

17、JavaBeans for creating reusable business components, JMS (Java Messaging Service)for messageoriented middleware, JAXP for XML processing, and JTA (Java Transaction API) for performing atomic transactions. In addition, J2EE also supports servlets , an extremely popular Java substitute for CGI scripts

18、. The combination of these technologies allows programmers to create distributed business solutions for a variety of tasks.In late 1999, Sun Microsystems added a new element to the collection of Enterprise Java tools: Java Server Pages (JSP). Java Server Pages are built on top of Java servlets and a

19、re designed to increase the efficiency in which programmers, and even nonprogrammers, can create web content.What Is Java Server Pages?Put succinctly, Java Server Pages is a technology for developing web pages that include dynamic content. Unlike a plain HTML page, which contains static content that

20、 always remains the same, a JSP page can change its content based on any number of variable items, including the identity of the user, the users browser type, information provided by the user, and selections made by the user.A JSP page contains standard markup language elements, such as HTML tags, j

21、ust like a regular web page. However, a JSP page also contains special JSP elements that allow the server to insert dynamic content in the page. JSP elements can be used for a variety of purposes,such as retrieving information from a databaseor registering user preferences. When a user asks for a JS

22、P page, the server executes the JSP elements, merges the results with the static parts of the page, and sends the dynamically composed page back to the browser.JSP defines a number of standard elements that are useful for any web application, such as accessingJavaBeanscomponents, passing control bet

23、ween pages and sharing information between requests, pages, and users. Programmers can also extend the JSP syntax by implementing application-specific elements that perform tasks such as accessing databases and Enterprise JavaBeans, sending email, and generating HTML to present application-specific

24、data. One such set of commonly needed custom elements is defined by a specification related to the JSP specification: the JSP Standard Tag Library (JSTL) specification. The combination of standard elements and custom elements allows for the creation of powerful web applications.Why Use JSP?In the ea

25、rly days of the Web, the Common Gateway Interface (CGI) was the only tool for developing dynamic web content. However, CGI is not an efficient solution. For every request that comes in, the web server has to create a new operating-system process, load an interpreter and a script, execute the script,

26、 and then tear it all down again. This is very taxing for the server and doesnt scale well when the amount of traffic increases.Numerous CGI alternatives and enhancements,such as FastCGI, mod_perl from Apache, NSAPI from Netscape, ISAPI from Microsoft, and Java servlets from Sun Microsystems, have b

27、een created over the years. While these solutions offer better performance and scalability, all these technologies suffer from a common problem: they generate web pages by embedding HTML directly in programming language code. This pushes the creation of dynamic web pages exclusively into the realm o

28、f programmers. Java Server Pages, however, changes all that.JSP tackles the problem from the other direction. Instead of embedding HTML in programming code, JSP lets you embed special active elements into HTML pages. These elements look similar to HTML elements, but behind the scenes they are actual

29、ly componentized Java programs that the server executes when a user requests the page. Heres a simple JSP page that illustrates this: c:when test=$clock.hours Good morning! c: when test=$clock.hours Good day! Good evening! Welcome to our site, open 24 hours a day. This page inserts a different messa

30、ge to the user based on the time of day: Good morning! if the local time is before 12 P.M., Good day! if between 12 P.M. and 6 P.M., and Good evening! otherwise. When a user asks for this page, the JSP-enabledweb server executes the logic represented by the highlighted JSP elements and creates an HT

31、ML page that is sent back to the users browser. For example, if the current time is 8:53 P.M., the resulting page sent from the server to the browser looks like this: Good evening! Welcome to our site, open 24 hours a day. In addition to the HTML-like JSP elements, a JSP page can also contain Java c

32、ode embedded in so-called scripting elements. This feature has been part of the JSP specification from the very first version, and it used to be convenient for simple conditional logic. With the introduction of the new JSP Standard Tag Library (JSTL), however, Java code in a page is rarely needed. I

33、n addition, embedding too much code in a web page is no better than using HTML elements in a server-side program, and often leads to a web application that is hard to maintain and debug.Using the Right Person for Each TaskAs I alluded to earlier, JSP allows you to separate the markup language code,

34、such as HTML, from the programming language code used to process user input, accessa databasesand perform other application tasks. One way this separation takes place is through the use of the JSP standard and custom elements; these elements are implemented with programming code and used the same wa

35、y as page markup elements in regular web pages.Another way to separate is to combine JSP with other J2EE technologies. For example, Java servlets can handle input processing, Enterprise JavaBeans (EJB) can take care of the application logic, and JSP pages can provide the user interface. This separat

36、ion means that with JSP, a typical business can divide its efforts among two groups that excel in their own areas of expertise: a Java web development team with programmers who implement the application logic as servlets, EJB and custom JSP elements, and page authors who craft the specifics of the i

37、nterface and use the powerful custom elements without having to do any programming.Integration with Enterprise Java APIsFinally, because Java Server Pages are built on top of the Java Servlets API, JSP has access to all the powerful Enterprise Java APIs, including:? JDBC? Remote Method Invocation (R

38、MI) and OMG CORBA support? JNDI (Java Naming and Directory Interface)? EnterpriseJavaBeans (EJB)? JMS (Java Message Service) ? JTA (Java Transaction API) ? JAXP (Java API for XML Processing)This means that you can easily integrate Java Server Pages with your existing Java Enterprise solutions.Java s

39、ervlet template engines .A Java servlet template engine is another technology for separating presentation from processing. When servlets became popular,it didnt take long before developers realized how hard it was to maintain the presentation part when the HTML code was embedded directly in the serv

40、lets Java code. As a result,a number of so-called template engines have been developed as open source products to help get HTML out of the servlets.Template engines are intended to be used with pure code components (servlets) and to use web pages with scripting code only for the presentation part. R

41、equests are sent to a servlet that processes the request, creates objects that represent the result, and calls on a web page template to generate the HTML to be sent to the browser. The template contains scripting code similar to the alternatives described earlier. The scripting languages used by th

42、ese engines are less powerful, however, since scripting is intended only for reading data objects and generating HTML code to display their values. All the other products and technologies support general-purpose languages, which can (for better or for worse) be used to include business logic in the

43、bines the most important features found in the alternatives:? JSP supports both scriptin-gand element-based dynamic content and allows programmers to develop custom tag libraries to satisfy application-specific needs. ? JSP pages are compiled for efficient server processing.? JSP pages can be used i

44、n combination with servlets that handle the busienss logic, the model supported by Java servlet template engines. In addition, JSP has a couple of unique advantages that make it stand out from the crowd:? JSP is a specification, not a product. This means vendors can compete with different implementations, leading to better performance and quali

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論