简体   繁体   English

Java,MyFaces 1.1,Tobago和如何创建可重用的Web组件

[英]Java, MyFaces 1.1, Tobago and How to create resusable web components

Assume you want to create some form of web-dialog that allows you to do something. 假设您要创建某种形式的网络对话框,以允许您执行某些操作。 For instance querying for some information by filtering some selection criterias. 例如,通过过滤一些选择标准来查询一些信息。 This dialog might consist of a couple of textboxes, labels, comboboxes and buttons. 该对话框可能包含几个文本框,标签,组合框和按钮。

Now you notice that exactly THIS dialog needs to be used in different places. 现在您注意到,该对话框确实需要在不同的地方使用。 However, the business objects that are bound to the combos might be different as well as maybe the lables that describe the other elements. 但是,绑定到组合的业务对象可能不同,描述其他元素的标签也可能不同。 But the rest is pretty much the same. 但是其余的几乎相同。

What is an effective way to create reusable web components if the underlying component framework is tobago and myfaces 1.1 is used? 如果基础组件框架是tobago并使用了myfaces 1.1,那么创建可重用Web组件的有效方法是什么?

If there is some tutorial available or you guys have some keywords for me to google that'd be awesome. 如果有一些可用的教程,或者你们对我来说有一些很棒的关键字可以搜索到Google。 Since I am new to Java I might not have looked for the correct buzzwords yet. 由于我是Java新手,所以我可能还没有寻找正确的流行词。 ;-) ;-)

MyFaces is an implementation of JSF. MyFaces是JSF的实现。 What you want to do is create a JSF custom component. 您要做的是创建一个JSF定制组件。 It is possible to create a jar file containing any number of components. 可以创建包含任意数量的组件的jar文件。

This tutorial should give you an idea of the steps involved. 本教程应该使您对所涉及的步骤有所了解。 Read the JSF 1.1 spec and write your own checklist . 阅读JSF 1.1规范并编写自己的清单 Since you are writing against an older version of JSF, watch for references to the newer 1.2/2.0 APIs (ignore any references to Facelets). 由于您使用的是旧版本的JSF,因此请注意对较新的1.2 / 2.0 API的引用(忽略对Facelets的任何引用)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM