【正文】
這也是 Inter 可以擴(kuò)展到很多計算機(jī)的原因。這稱之為狀態(tài)協(xié)議。 很多服務(wù)器應(yīng)用程序使用 HTTP 之外的其他協(xié)議。外交協(xié)議主要設(shè)計來避免誤解,以及防止談 判破裂。這些技術(shù)并不是專門針對 Struts,而是所有 Java web 應(yīng)用都可以使用的。 Struts 以及本文中涉及的組件卻不是這樣。在其它的資料里面,我們也介紹了一些可以 和 Struts 一起使用的框架。構(gòu)架在這些公共基礎(chǔ)上的應(yīng)用框架可以為開發(fā)人員提供可以為他們的產(chǎn)品提供可重用服務(wù)的基礎(chǔ)架構(gòu)。 they do not retrieve them. The mutator for a simple property takes 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: public void setWeight(Double weight) A similar design pattern is used to create the accessor method signature. Accessor methods are always prefixed with the lowercase token get, followed by the 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 their method signature. Not surprisingly, accessors are often called getters. The accessor method signature for our weight property is: public Double getWeight() 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 property 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. The boolean accessor method signature for an on property would be public boolean isOn() The canonical method signatures play an important role when working with Java Beans. Other ponents are able to use the Java Reflection API to discover a JavaBean’s properties by looking 大連交通大學(xué)信息工程學(xué)院 2020 屆本科生畢業(yè)設(shè)計 (論文 )外文翻譯 17 for methods prefixed by set, is, or get. If a ponent finds such a signature on a JavaBean, it knows that the method can be used to access or change the bean’s properties. Sun introduced JavaBeans to work with GUI ponents, but they are now used with every aspect of Java development, including web applications. When Sun engineers developed 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. For more on JavaBeans, we highly remend The Awesome Power of JavaBeans, by Lawrence H. Rodrigues [Rodrigues]. The definitive source for JavaBean information is the JavaBean Specification [Sun, JBS]. Model 2: The release of the Servlet/JSP Specification described Model 2 as an architecture that uses servlets and JSP pages together in the same application. The term Model 2 disappeared from later releases, but it remains in popular use among Java web developers. Under Model 2, servlets handle the data access and navigational flow, while JSP pages handle 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 application. HTML developers can often change the look and feel of an application without changing how the backoffice servlets work. The Struts framework is based on the Model 2 architecture. It provides 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. Summary: In this article, we introduced Struts as an application framework. We examined the technology behind HTTP, the Common Gateway Interface, Java servlets, JSPs, and JavaBeans. We also looked at the Model 2 application architecture to see how it is used to bine servlets and JSPs in the same application. Now that you have had a taste of what it is like to develop a web application with Struts, in chapter 2 we dig deeper into the theory and practice behind the Struts architecture. 0 JSP 應(yīng)用框架 什么是應(yīng)用框架: 框架( framework)是可重用的,半成品的應(yīng)用程序,可以用來產(chǎn)生專門的定制程序。 [12] 張基溫 .信息系統(tǒng)開發(fā)案例 [M].北京清華大學(xué)出版社 .2020 [13] 薩師煊 .王珊 . 數(shù)據(jù)庫系統(tǒng)概論 [M].北京:高等教育出版社 .2020 大連交通大學(xué)信息工程 學(xué)院 大連交通大學(xué)信息工程學(xué)院 2020 屆本科生畢業(yè)設(shè)計 (論文 )外文翻譯 11 畢業(yè)設(shè)計 (論文 )外文翻譯 學(xué)生姓名 王旭弘 專業(yè)班級 軟件工程 082班 指導(dǎo)教 師 王鑫 翟悅 職 稱 高工 講師 所在單位 信息科學(xué)系 軟件工程 教研室 教研室主任 劉瑞杰 完成日期 2020 年 4 月 13 日 JSP application frameworks What are application frameworks: A framework is a reusable, semiplete application that can be specialized to produce custom applications [Johnson]. Like people, software applications are more alike than they are different. They run on the same puters, expect input from the same devices, output to the same displays, and save data to the same hard 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 mon ground to provide developers with a reusable structure that can serve as the foundation for their own products. 大連交通大學(xué)信息工程學(xué)院 2020 屆本科生畢業(yè)設(shè)計 (論文 )外文翻譯 12 A framework provides developers with a set of backbone ponents that have the following characteristics: are known to work well in other applications. 2. They are ready to use with the next project. 3. They can also be used by other teams in the anization. Frameworks are the classic buildversusbuy 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 that going to take? There is no right answer here, but most observers would agree that framewo