菜单
  

    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 portion. 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.
    JavaBeans:
    JavaBeans are Java classes which conform to a set of design patterns that make them easier to use with development tools and other components.
    DEFINITION A JavaBean is a reusable software component written in Java. To qualify 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 the property names follow this pattern, other Java classes are able to use introspection to discover and manipulate JavaBean properties.
    The JavaBean design patterns provide access to the bean’s internal state through two flavors of methods: accessors are used to read a JavaBean’s state; mutators are used to change a JavaBean’s state.
    Mutators are always prefixed with lowercase token set followed 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 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 components 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 component 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 components, 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 recommend 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 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. 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 back-office servlets work.
  1. 上一篇:B/S/Browser/Server结构英文文献和中文翻译
  2. 下一篇:ASP英文参考文献翻译
  1. JUC同步框架英文文献和中文翻译

  2. 碳化硅电器元件的应用英文文献和中文翻译

  3. 数字通信技术在塑料挤出...

  4. 改善重型SCR系统的应用程...

  5. CAE技术在车辆安全性应用英文文献和中文翻译

  6. MySQL和JSP的Web应用程序英文文献和中文翻译

  7. C#的应用英文文献和中文翻译

  8. 高警觉工作人群的元情绪...

  9. C++最短路径算法研究和程序设计

  10. 中国传统元素在游戏角色...

  11. 现代简约美式风格在室内家装中的运用

  12. 江苏省某高中学生体质现状的调查研究

  13. NFC协议物理层的软件实现+文献综述

  14. 上市公司股权结构对经营绩效的影响研究

  15. g-C3N4光催化剂的制备和光催化性能研究

  16. 浅析中国古代宗法制度

  17. 巴金《激流三部曲》高觉新的悲剧命运

  

About

优尔论文网手机版...

主页:http://www.youerw.com

关闭返回