【正文】
cessors 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 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 大連交通大學(xué)信息工程學(xué)院 2021 屆本科生畢業(yè)設(shè)計(jì)(論文)外文翻譯 5 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. 大連交通大學(xué)信息工程學(xué)院 2021 屆本科生畢業(yè)設(shè)計(jì)(論文)外文翻譯 6 JSP 應(yīng)用框架 什么是 應(yīng)用框架: 框架( framework)是可重用的,半成品的應(yīng)用程序,可以用來(lái)產(chǎn)生專門的定制程序。 is all too mon in servlets that generate the HTTP response. There are libraries that can help you generate HTML, but as applications grow more plex, Java developers end up being cast into the role of HTML page designers. Meanwhile, given the choice, most project managers prefer to divide development teams into specialized groups. They l