gpt4 book ai didi

java - JSF中 "component"的定义是什么

转载 作者:搜寻专家 更新时间:2023-11-01 01:47:39 24 4
gpt4 key购买 nike

JSF 2.0 中“组件”的定义是什么?

在 JSF 2.0 中使用的 Facelets 中组件的定义是什么?

当然,我用谷歌搜索了它,但没有找到简短而明确的答案。

最佳答案

定义在 JSF 规范中。这是 JSF 2.0 specification 的第 3 章介绍中的引文, 定义包含在第 1 段中:

User Interface Component Model

A JSF user interface component is the basic building block for creating a JSF user interface. A particular component represents a configurable and reusable element in the user interface, which may range in complexity from simple (such as a button or text field) to compound (such as a tree control or table). Components can optionally be associated with corresponding objects in the data model of an application, via value expressions.

JSF also supports user interface components with several additional helper APIs:

  • Converters—Pluggable support class to convert the markup value of a component to and from the corresponding type in the model tier.
  • Events and Listeners—An event broadcast and listener registration model based on the design patterns of the JavaBeans Specification, version 1.0.1.
  • Validators—Pluggable support classes that can examine the local value of a component (as received in an incoming request) and ensure that it conforms to the business rules enforced by each Validator. Error messages for validation failures can be generated and sent back to the user during rendering.

The user interface for a particular page of a JSF-based web application is created by assembling the user interface components for a particular request or response into a view. The view is a tree of classes that implement UIComponent. The components in the tree have parent-child relationships with other components, starting at the root element of the tree, which must be an instance of UIViewRoot. Components in the tree can be anonymous or they can be given a component identifier by the framework user. Components in the tree can be located based on component identifiers, which must be unique within the scope of the nearest ancestor to the component that is a naming container. For complex rendering scenarios, components can also be attached to other components as facets.

Facelets 是一种 View 技术,它允许您定义 View ,如上述引用的最后一段中所述。

关于java - JSF中 "component"的定义是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4722635/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com