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 ins开发者_如何学Pythontance 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?
If there is some tutorial available or you guys have some keywords for me to google that'd be awesome. Since I am new to Java I might not have looked for the correct buzzwords yet. ;-)
MyFaces is an implementation of JSF. What you want to do is create a JSF custom component. It is possible to create a jar file containing any number of components.
This tutorial should give you an idea of the steps involved. Read the JSF 1.1 spec and write your own checklist. 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).
精彩评论