版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、<p><b> 外文資料翻譯</b></p><p> ?。?2011 屆大學(xué)本科)</p><p> 題 目: </p><p> 學(xué) 院:
2、 </p><p> 專(zhuān) 業(yè): </p><p> 班 級(jí): </p><p> 姓 名:
3、 </p><p> 學(xué) 號(hào): </p><p> 主指導(dǎo)教師: </p><p> 2011年 02 月 24 日</p><p> 教務(wù)處印制
4、 </p><p><b> 外文原文</b></p><p> JSP application frameworks</p><p> brian wright、michael freedman</p><p> http://book.huihoo.com/pdf/introduction-to
5、-machine-learning/ </p><p> What are application frameworks:</p><p> A framework is a reusable, semi-complete application that can be specialized to</p><p> produce custom applic
6、ations [Johnson]. Like people, software applications are more alike than they are different. They run on the same computers, expect input from the same devices, output to the same displays, and save data to the same hard
7、 disks. Developers working on conventional desktop applications are accustomed to toolkits and development environments that leverage the sameness between applications. Application frameworks build on this common ground
8、to provide developers with a reusable s</p><p> A framework provides developers with a set of backbone components that have the following characteristics:</p><p> 1.They are known to work well
9、 in other applications.</p><p> 2. They are ready to use with the next project.</p><p> 3. They can also be used by other teams in the organization.</p><p> Frameworks are the cl
10、assic build-versus-buy proposition. If you build it, you will understand it when you are done—but how long will it be before you can roll your own? If you buy it, you will have to climb the learning curve—and how long is
11、 that going to take? There is no right answer here, but most observers would agree that frameworks such as Struts provide a significant return on investment compared to starting from scratch, especially for larger projec
12、ts.</p><p> Other types of frameworks:</p><p> The idea of a framework applies not only to applications but to application componentsas well. Throughout this article, we introduce other types
13、of frameworks that you can use with Struts. These include the Lucene search engine, the Scaffold toolkit, the Struts validator, and the Tiles tag library. Like application frameworks, these tools provide semi-complete ve
14、rsions of a subsystem that can be specialized to provide a custom component.</p><p> Some frameworks have been linked to a proprietary development environment. This is not the case with Struts or any of the
15、 other frameworks shown in this book. You can use any development environment with Struts: Visual Age for Java, JBuilder, Eclipse, Emacs, and Textpad are all popular choices among Struts developers. If you can use it wit
16、h Java, you can use it with Struts.</p><p> Enabling technologies:</p><p> Applications developed with Struts are based on a number of enabling technologies.These components are not specific t
17、o Struts and underlie every Java web application. A reason that developers use frameworks like Struts is to hide the nasty details behind acronyms like HTTP, CGI, and JSP. As a Struts developer, you don’t need to be an a
18、lphabet soup guru, but a working knowledge of these base technologies can help you devise creative solutions to tricky problems.</p><p> Hypertext Transfer Protocol (HTTP):</p><p> When mediat
19、ing talks between nations, diplomats often follow a formal protocol.</p><p> Diplomatic protocols are designed to avoid misunderstandings and to keep negotiations from breaking down. In a similar vein, when
20、 computers need to talk, they also follow a formal protocol. The protocol defines how data is transmitted and how to decode it once it arrives. Web applications use the Hypertext Transfer Protocol (HTTP) to move data bet
21、ween the browser running on your computer and the application running on the server.</p><p> Many server applications communicate using protocols other than HTTP. Some of these maintain an ongoing connectio
22、n between the computers. The application server knows exactly who is connected at all times and can tell when a connection is dropped. Because they know the state of each connection and the identity of each person using
23、it, these are known as stateful protocols.</p><p> By contrast, HTTP is known as a stateless protocol. An HTTP server will accept any request from any client and will always provide some type of response, e
24、ven if the response is just to say no. Without the overhead of negotiating and retaining a connection, stateless protocols can handle a large volume of requests. This is one reason why the Internet has been able to scale
25、 to millions of computers.</p><p> Another reason HTTP has become the universal standard is its simplicity. An HTTP request looks like an ordinary text document. This has made it easy for applications to ma
26、ke HTTP requests. You can even send an HTTP request by hand using a standard utility such as Telnet. When the HTTP response comes back, it is also in plain text that developers can read.</p><p> The first l
27、ine in the HTTP request contains the method, followed by the location</p><p> of the requested resource and the version of HTTP. Zero or more HTTP request headers follow the initial line. The HTTP headers p
28、rovide additional information to the server. This can include the browser type and version, acceptable document types, and the browser’s cookies, just to name a few. Of the seven request methods, GET and POST are by far
29、the most popular.</p><p> Once the server has received and serviced the request, it will issue an HTTP response. The first line in the response is called the status line and carries the HTTP protocol versio
30、n, a numeric status, and a brief description of the status. Following the status line, the server will return a set of HTTP response headers that work in a way similar to the request headers.</p><p> As we
31、mentioned, HTTP does not preserve state information between requests.The server logs the request, sends the response, and goes blissfully on to the next request. While simple and efficient, a stateless protocol is proble
32、matic for dynamic applications that need to keep track of their users. (Ignorance is not always bliss.</p><p> Cookies and URL rewriting are two common ways to keep track of users between requests. A cookie
33、 is a special packet of information on the user’s computer. URL rewriting stores a special reference in the page address that a Java server can use to track users. Neither approach is seamless, and using either means ext
34、ra work when developing a web application. On its own, a standard HTTP web server does not traffic in dynamic content. It mainly uses the request to locate a file and then returns that </p><p> Standard web
35、 servers handle static content and images quite well but need a helping hand to provide users with a customized, dynamic response. </p><p> DEFINITION:Static content on the Web comes directly from text or d
36、ata files, like HTML or JPEG files. These files might be changed from time to time, but they are not altered automatically when requested by a web browser. Dynamic content, on the other hand, is generated on the fly, typ
37、ically in response to an individualized request from a browser.</p><p> Common Gateway Interface (CGI):</p><p> The first widely used standard for producing dynamic content was the Common Gate
38、way Interface (CGI). CGI uses standard operating system features, such as environment variables and standard input and output, to create a bridge, or gateway, between the web server and other applications on the host mac
39、hine. The other applications can look at the request sent to them by the web server and create a customized response.</p><p> When a web server receives a request that’s intended for a CGI program, it runs
40、that program and provides the program with information from the incoming request. The CGI program runs and sends its output back to the server. The web server then relays the response to the browser.</p><p>
41、 CGI defines a set of conventions regarding what information it will pass as environment variables and how it expects standard input and output to be used. Like HTTP, CGI is flexible and easy to implement, and a great n
42、umber of CGI-aware programs have been written.</p><p> The main drawback to CGI is that it must run a new copy of the CGI-aware program for each request. This is a relatively expensive process that can bog
43、down high-volume sites where thousands of requests are serviced per minute. Another drawback is that CGI programs tend to be platform dependent. A CGI program written for one operating system may not run on another.</
44、p><p> Java servlets:</p><p> Sun’s Java Servlet platform directly addresses the two main drawbacks of CGI programs.First, servlets offer better performance and utilization of resources than conv
45、entional CGI programs. Second, the write-once, run-anywhere nature of Java means that servlets are portable between operating systems that have a Java Virtual Machine (JVM).</p><p> A servlet looks and feel
46、s like a miniature web server. It receives a request and renders a response. But, unlike conventional web servers, the servlet application programming interface (API) is specifically designed to help Java developers crea
47、te dynamic applications.</p><p> The servlet itself is simply a Java class that has been compiled into byte code, like any other Java object. The servlet has access to a rich API of HTTP-specific services,
48、but it is still just another Java object running in an application and can leverage all your other Java assets.</p><p> To give conventional web servers access to servlets, the servlets are plugged into con
49、tainers. The servlet container is attached to the web server. Each servlet can declare what URL patterns it would like to handle. When a request matching a registered pattern arrives, the web server passes the request to
50、 the container, and the container invokes the servlet.</p><p> But unlike CGI programs, a new servlet is not created for each request. Once the container instantiates the servlet, it will just create a new
51、thread for each request. Java threads are much less expensive than the server processes used by CGI programs. Once the servlet has been created, using it for additional requests incurs very little overhead. Servlet devel
52、opers can use the init() method to hold references to expensive resources, such as database connections or EJB Home Interfaces, so that t</p><p> The other edge of the sword is that, since servlets are mult
53、ithreaded, servlet developers must take special care to be sure their servlets are thread-safe. To learn more about servlet programming, we recommend Java Servlets by Example, by Alan R. Williamson [Williamson]. The defi
54、nitive source for Servlet information is the Java Servlet Specification [Sun, JST].</p><p> JavaServer Pages:</p><p> While Java servlets are a big step up from CGI programs, they are not a pa
55、nacea. To generate the response, developers are still stuck with using println statements to render the HTML. Code that looks like:</p><p> out.println("<P>One line of HTML.</P>");<
56、/p><p> out.println("<P>Another line of HTML.</P>");</p><p> is all too common in servlets that generate the HTTP response. There are libraries that can help you generate HT
57、ML, but as applications grow more complex, Java developers end up being cast into the role of HTML page designers.</p><p> Meanwhile, given the choice, most project managers prefer to divide development tea
58、ms into specialized groups. They like HTML designers to be working on the presentation while Java engineers sweat the business logic. Using servlets alone encourages mixing markup with business logic, making it difficult
59、 for team members to specialize.</p><p> To solve this problem, Sun turned to the idea of using server pages to combine scripting and templating technologies into a single component. To build Java Server Pa
60、ges, developers start by creating HTML pages in the same old way, using the same old HTML syntax. To bring dynamic content into the page, the developer can also place JSP scripting elements on the page. Scripting element
61、s are tags that encapsulate logic that is recognized by the JSP. You can easily pick out scripting elements on JSP </p><p> To be seen as a JSP page, the file just needs to be saved with an extension of .js
62、p.</p><p> When a client requests the JSP page, the container translates the page into a source code file for a Java servlet and compiles the source into a Java class file—just as you would do if you were w
63、riting a servlet from scratch. At runtime, the container can also check the last modified date of the JSP file against the class file. If the JSP file has changed since it was last compiled, the container will retranslat
64、e and rebuild the page all over again.</p><p> Project managers can now assign the presentation layer to HTML developers, who then pass on their work to Java developers to complete the business-logic portio
65、n. The important thing to remember is that a JSP page is really just a servlet. Anything you can do with a servlet, you can do with a JSP.</p><p> JavaBeans:</p><p> JavaBeans are Java classes
66、 which conform to a set of design patterns that make them easier to use with development tools and other components.</p><p> DEFINITION A JavaBean is a reusable software component written in Java. To qualif
67、y as a JavaBean, the class must be concrete and public, and have a noargument constructor. JavaBeans expose internal fields as properties by providing public methods that follow a consistent design pattern. Knowing that
68、the property names follow this pattern, other Java classes are able to use introspection to discover and manipulate JavaBean properties. </p><p> The JavaBean design patterns provide access to the bean’s in
69、ternal state through two flavors of methods: accessors are used to read a JavaBean’s state; mutators are used to change a JavaBean’s state.</p><p> Mutators are always prefixed with lowercase token set foll
70、owed by the property name. The first character in the property name must be uppercase. The return value is always void—mutators only change property values; they do not retrieve them. The mutator for a simple property ta
71、kes only one parameter in its signature, which can be of any type. Mutators are often nicknamed setters after their prefix. The mutator method signature for a weight property of the type Double would be:</p><p
72、> public void setWeight(Double weight)</p><p> A similar design pattern is used to create the accessor method signature. Accessor methods are always prefixed with the lowercase token get, followed by th
73、e property name. The first character in the property name must be uppercase. The return value will match the method parameter in the corresponding mutator. Accessors for simple properties cannot accept parameters in thei
74、r method signature. Not surprisingly, accessors are often called getters.</p><p> The accessor method signature for our weight property is:</p><p> public Double getWeight()</p><p&g
75、t; If the accessor returns a logical value, there is a variant pattern. Instead of using the lowercase token get, a logical property can use the prefix is, followed by the property name. The first character in the prope
76、rty name must be uppercase. The return value will always be a logical value—either boolean or Boolean. Logical accessors cannot accept parameters in their method signature.</p><p> The boolean accessor meth
77、od signature for an on property would be</p><p> public boolean isOn()</p><p> The canonical method signatures play an important role when working with Java- Beans. Other components are able t
78、o use the Java Reflection API to discover a JavaBean’s properties by looking for methods prefixed by set, is, or get. If a component finds such a signature on a JavaBean, it knows that the method can be used to access or
79、 change the bean’s properties.</p><p> Sun introduced JavaBeans to work with GUI components, but they are now used with every aspect of Java development, including web applications. When Sun engineers devel
80、oped the JSP tag extension classes, they designed them to work with JavaBeans. The dynamic data for a page can be passed as a JavaBean, and the JSP tag can then use the bean’s properties to customize the output.</p>
81、;<p> For more on JavaBeans, we highly recommend The Awesome Power of JavaBeans, by Lawrence H. Rodrigues [Rodrigues]. The definitive source for JavaBean information is the JavaBean Specification [Sun, JBS].</
82、p><p><b> Model 2:</b></p><p> The 0.92 release of the Servlet/JSP Specification described Model 2 as an architecture that uses servlets and JSP pages together in the same application
83、. The term Model 2 disappeared from later releases, but it remains in popular use among Java web developers.</p><p> Under Model 2, servlets handle the data access and navigational flow, while JSP pages han
84、dle the presentation. Model 2 lets Java engineers and HTML developers each work on their own part of the application. A change in one part of a Model 2 application does not mandate a change to another part of the applica
85、tion. HTML developers can often change the look and feel of an application without changing how the back-office servlets work.</p><p> The Struts framework is based on the Model 2 architecture. It provides
86、a controller servlet to handle the navigational flow and special classes to help with the data access. A substantial custom tag library is bundled with the framework to make Struts easy to use with JSP pages.</p>
87、<p><b> Summary:</b></p><p> In this article, we introduced Struts as an application framework. We examined the technology behind HTTP, the Common Gateway Interface, Java servlets, JSPs, a
88、nd JavaBeans. We also looked at the Model 2 application architecture to see how it is used to combine servlets and JSPs in the same application.</p><p> Now that you have had a taste of what it is like to d
89、evelop a web application with Struts, in chapter 2 we dig deeper into the theory and practice behind the Struts architecture.</p><p><b> 外文翻譯</b></p><p><b> JSP 應(yīng)用框架</b>
90、;</p><p> brian wright、michael freedman</p><p> http://book.huihoo.com/pdf/introduction-to-machine-learning/</p><p><b> 什么是應(yīng)用框架:</b></p><p> 框架(framewor
91、k)是可重用的,半成品的應(yīng)用程序,可以用來(lái)產(chǎn)生專(zhuān)門(mén)的定制程序。象人一樣,軟件應(yīng)用的相似性比不同點(diǎn)要多。它們運(yùn)行在相似的機(jī)器上,期望從相同的設(shè)備輸入信息,輸出到相同的顯示設(shè)備,并且將數(shù)據(jù)存儲(chǔ)到相同的硬盤(pán)設(shè)備。開(kāi)發(fā)傳統(tǒng)桌面應(yīng)用的開(kāi)發(fā)人員更習(xí)慣于那些可以涵蓋應(yīng)用開(kāi)發(fā)同一性的工具包和開(kāi)發(fā)環(huán)境。構(gòu)架在這些公共基礎(chǔ)上的應(yīng)用框架可以為開(kāi)發(fā)人員提供可以為他們的產(chǎn)品提供可重用服務(wù)的基礎(chǔ)架構(gòu)。</p><p> 框架向開(kāi)發(fā)人員提供
92、一系列具有以下特征的骨架組件:</p><p> 1.已經(jīng)知道它們?cè)谄渌绦蛏瞎ぷ鞯煤芎茫?lt;/p><p> 2.它們隨時(shí)可以在下一個(gè)項(xiàng)目中使用;</p><p> 3.它們可以被組織的其它團(tuán)隊(duì)使用;</p><p> 對(duì)于框架是典型的構(gòu)建還是購(gòu)買(mǎi)命題。如果你自己構(gòu)建它,在你完成時(shí)你就會(huì)理解它,但是在你被融入之前又將花費(fèi)多長(zhǎng)時(shí)間呢?如
93、果要購(gòu)買(mǎi),你必須得克服學(xué)習(xí)曲線,同樣,在你可以用它進(jìn)行工作之前又得花多長(zhǎng)時(shí)間?這里沒(méi)有所謂正確答案,但許多觀察者都會(huì)同意,象Struts這樣的框架能提供比從頭開(kāi)始開(kāi)發(fā)更顯著的投資回報(bào),特別是對(duì)于大型項(xiàng)目來(lái)說(shuō)。</p><p><b> 其它類(lèi)型的框架:</b></p><p> 框架的概念不僅用于應(yīng)用程序也可用于組件。在其它的資料里面,我們也介紹了一些可以和Str
94、uts一起使用的框架。這些包括Lucene搜索引擎,Scaffold工具包,Struts驗(yàn)證器,以及Tiles標(biāo)簽庫(kù)。與應(yīng)用框架一樣,這些工具也提供了一些半完成的版本,可以用在用戶的定制組件之中。某些框架被限制于專(zhuān)門(mén)的開(kāi)發(fā)環(huán)境中。Struts以及本文中涉及的組件卻不是這樣。你可以在很多環(huán)境中來(lái)開(kāi)發(fā)Struts: Visual Age for Java, JBuilder, Eclipse, Emacs, 甚至使用Textpad。對(duì)于你的
95、工具,如果你可以用來(lái)開(kāi)發(fā)Java, 你就可以用它來(lái)開(kāi)發(fā)Struts。</p><p><b> 使用的技術(shù):</b></p><p> 使用Struts的應(yīng)用開(kāi)發(fā)使用了大量的其他基礎(chǔ)技術(shù)。這些技術(shù)并不是專(zhuān)門(mén)針對(duì)Struts,而是所有Java web 應(yīng)用都可以使用的。開(kāi)發(fā)者使用Struts之類(lèi)的框架是為了隱藏在諸如HTTP,CGI,以及JSP之類(lèi)技術(shù)后面的繁瑣的細(xì)
96、節(jié)。作為一個(gè)Struts開(kāi)發(fā)者,你并不需要知曉所有的相關(guān)知識(shí),但是這些基本技術(shù)的工作原理可能有助于你針對(duì)棘手問(wèn)題設(shè)計(jì)出創(chuàng)造性的方案。</p><p> 超文本傳輸協(xié)議 (HTTP):</p><p> 當(dāng)兩個(gè)國(guó)家之間進(jìn)行調(diào)解時(shí),外交官們總是遵循一定的正式協(xié)議。外交協(xié)議主要設(shè)計(jì)來(lái)避免誤解,以及防止談判破裂。同樣,當(dāng)計(jì)算機(jī)間需要對(duì)話,它們也遵循一個(gè)正式的協(xié)議。這個(gè)協(xié)議定義數(shù)據(jù)是如何傳輸,以
97、及它們到達(dá)后如何進(jìn)行解碼。Web應(yīng)用程序就是使用HTTP協(xié)議在運(yùn)行瀏覽器的計(jì)算機(jī)和運(yùn)行的服務(wù)器的程序間傳輸數(shù)據(jù)。</p><p> 很多服務(wù)器應(yīng)用程序使用HTTP之外的其他協(xié)議。他們?cè)谟?jì)算機(jī)之間維護(hù)一個(gè)持久性的連接。應(yīng)用服務(wù)器可以清楚的知道是誰(shuí)連接上來(lái),而且何時(shí)中斷連接。因?yàn)樗鼈冎烂恳粋€(gè)連接的狀態(tài),以及每一個(gè)使用它的人。這稱(chēng)之為狀態(tài)協(xié)議。</p><p> 相反, HTTP是一個(gè)無(wú)狀
98、態(tài)協(xié)議。HTTP Server 可以接受來(lái)自于各種客戶的各種請(qǐng)求,并提供各種響應(yīng),即使是這個(gè)響應(yīng)僅僅是說(shuō)No。沒(méi)有大量的協(xié)商和連接持久性,無(wú)狀態(tài)協(xié)議可以處理大量的請(qǐng)求。這也是Internet 可以擴(kuò)展到很多計(jì)算機(jī)的原因。</p><p> HTTP 成為通用標(biāo)準(zhǔn)的原因是其簡(jiǎn)單性。HTTP請(qǐng)求看起來(lái)就像一個(gè)平常的文本文檔。這使應(yīng)用程序很容易創(chuàng)建HTTP請(qǐng)求。你甚至可以通過(guò)標(biāo)準(zhǔn)的程序如Telnet來(lái)手動(dòng)傳遞一個(gè)HT
99、TP請(qǐng)求。當(dāng)HTTP響應(yīng)返回時(shí),它也是一個(gè)開(kāi)發(fā)者可以直接閱讀的平面文本。HTTP請(qǐng)求的第一行包含方法,其后是請(qǐng)求的來(lái)源地址和HTTP版本。HTTP請(qǐng)求頭跟在首行后面,可以沒(méi)有也可以有多個(gè)。HTTP頭向服務(wù)器提供額外的信息??梢园g覽器的種類(lèi)和版本,可接受的文檔類(lèi)型,瀏覽器的cookies等等。7 種請(qǐng)求方法中, GET和 POST是用得最多的。</p><p> 一旦服務(wù)器接收到請(qǐng)求,它就要產(chǎn)生一個(gè)HTTP響
溫馨提示
- 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ù)僅提供信息存儲(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 應(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ù)概述與應(yīng)用框架外文翻譯
- 計(jì)算機(jī)外文翻譯---jsp應(yīng)用框架
- 計(jì)算機(jī)外文翻譯---jsp 應(yīng)用框架
- 計(jì)算機(jī)專(zhuān)業(yè)外文翻譯---jsp 應(yīng)用框架
- jsp 應(yīng)用框架外文翻譯、中英對(duì)照、英漢互譯
- JSP技術(shù)概述與應(yīng)用框架外文翻譯畢業(yè)設(shè)計(jì).doc
- jsp外文翻譯
- 外文翻譯---jsp簡(jiǎn)介
- jsp 技術(shù)外文翻譯
- jsp技術(shù)外文翻譯
- 外文翻譯---jsp簡(jiǎn)介
- jsp 外文翻譯--jsp及其web技術(shù)
- jsp介紹外文翻譯
評(píng)論
0/150
提交評(píng)論