Geertjan is a DZone Zone Leader and has posted 466 posts at DZone. You can read more from them at their website. View Full User Profile

Learning from Reverse Engineered JSF Components (Part 1)

08.29.2008
| 6431 views |
  • submit to reddit
One thing I really enjoy doing is reverse engineering technology solutions to learn from them. A case in point is Manfred Riem's set of JSF components, with sources available at the Manor Rock site.

In this context I took the sources of Manfred's NAL Component. (Here NAL stands for "name and location", consisting of a common set of entry fields on many web applications, for inputting the name and address details of the customer in question.) This is a JSF component that requires nothing more than this tag in a JSF file:

<nal:inputNAL value="#{NalBean}" />

Then, if the referenced bean is a registered JSF managed bean that extends the JSF component's NAL class, the tag above will magically render as follows:

This was a nicely understandable scenario, so I took the sources and imported them into NetBeans IDE, as a standard Java application, which is the first application you see in the screenshot below. The second application is the web application where I've implemented the JSF component:

Handily, by putting the Java application that provides the JSF component on the web application's classpath (i.e., via the Libraries node in the lower part of the screenshot above) in NetBeans IDE, it is rebuilt whenever I rebuild the web application. That's pretty useful.

In the next part, we'll look at all the files in the JSF component, to see how they work together to let the web application developer make use of the JSF tag shown above!

Read Part 2 Here 

 

AttachmentSize
fig-1.png43.59 KB
fig-2.png11.84 KB
Published at DZone with permission of its author, Geertjan Wielenga.