国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

使用Java Server Faces技術自定義組件

2019-11-18 13:43:56
字體:
來源:轉載
供稿:網友

  CUSTOM COMPONENTS WITH javaSERVER FACES TECHNOLOGY
The March 24, 2004 Tech Tip ImPRoving Designs With the MVC Design Pattern introdUCed the architectural pattern known as Model, View, Controller (MVC or Model2). MVC is a pervasive pattern throughout the world of computer science, and is fundamental to understanding JavaServer Faces (JSF) technology. The pattern separates the data and business logic of an application from its visual representation. The data and business logic is stored in an object called the Model. The visual representation is stored in a separate object called the View. The two objects are linked together with a third object called the Controller. The controller reacts to input from the view and updates the model data accordingly. The advantage of using this design is that any changes to the business logic or data can be isolated to the model without affecting the view. You can create multiple views without affecting the model.

A second tip in the March 24, 2004, titled Introducing JavaServer Faces Technology showed how to create a JSF application that includes GUI components that are modeled by the JSF framework. In this tip, you'll learn how to create custom components using JSF technology. More specifically, you'll learn how to create a custom JSF technology component that represents a simple stock display. Through an accompanying JavaServer Pages (jsp) page, a user can enter a stock symbol into a input text field and then press the Submit button. In response, the custom component displays a table below the text field. The table contains the stock's symbol, the current price of the stock, and the daily change in the stock price.

This tip assumes that you are familiar with the basics of JSF technology, and you know how to create JSP technology custom tag libraries. For information on the basics of JSF technology, see An Introduction to JavaServer Faces. For information on creating your own JSP custom tag libraries, see Using Custom Tags in the J2EE 1.4 Tutorial.

To create the custom component, you need to:

Create a JavaBean Model class that can be used to retrieve the stock data


Create a custom JSF View output component class that extends javax.faces.component.UIComponent.


Create a custom JSF View class that extends javax.faces.render.Renderer.


Integrate the custom component into the JSF framework using a custom tag.


Create a JSP page, including an input text field, and a backing bean for the input text field to assist the custom component.


Here is a visual representaion of how these objects fit in the MVC architecture.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 渭南市| 贺兰县| 叙永县| 桦南县| 七台河市| 洪雅县| 安新县| 江都市| 桃园市| 洛扎县| 西吉县| 安陆市| 凤台县| 徐州市| 阿合奇县| 南京市| 江源县| 宜兰市| 岳西县| 砀山县| 苏尼特左旗| 烟台市| 富源县| 元江| 伊宁市| 马公市| 沿河| 慈溪市| 海兴县| 星座| 德令哈市| 广州市| 开封县| 门头沟区| 聂拉木县| 伽师县| 遵化市| 深州市| 溧阳市| 缙云县| 饶河县|