本文介绍了“组件"的定义是什么?在JSF中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

What is the definition of "component" in JSF 2.0?

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

What is the definition of component in Facelets used in JSF 2.0?

我当然搜索过它,但是没有找到简短明了的答案.

Of course I googled for it but I did not find a short and clear answer.

推荐答案

该定义在JSF规范中.以下是 JSF 2.0规范的第3章的引证,该定义包含在第一段中:

The definition is in the JSF specification. Here's a cite from the introduction of chapter 3 of the JSF 2.0 specification, the definition is covered in the 1st paragraph:

JSF还通过其他一些辅助API支持用户界面组件:

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

  • 转换器-可插入支持类,用于将组件的标记值与模型层中的相应类型进行相互转换.
  • 事件和侦听器-基于JavaBeans规范1.0.1版的设计模式的事件广播和侦听器注册模型.
  • Validators -可插拔的支持类,可以检查组件的本地值(在传入请求中接收),并确保其符合每个Validator强制执行的业务规则.可以在渲染期间生成验证失败的错误消息并将其发送回用户.
  • 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.

基于JSF的Web应用程序特定页面的用户界面是通过将用于特定请求或响应的用户界面组件组合到视图中而创建的.该视图是实现UIComponent的类的树.树中的组件与其他组件具有父子关系,从树的 root元素开始,该元素必须是UIViewRoot的实例.树中的组件可以是匿名的,也可以由框架用户为其提供组件标识符.可以基于组件标识符来定位树中的组件,该标识符在与命名容器组件最接近的祖先范围内必须是唯一的.对于复杂的渲染方案,组件也可以作为 facets 附加到其他组件.

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 .

Facelets is a view technology which allows you to define the view as mentioned in the last paragraph of the above citation.

这篇关于“组件"的定义是什么?在JSF中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 16:37