Introduction
JavaServerTM Faces is a technology that helps to build a user interface based on the
components approach. Using UI Components as building blocks simplifies the development,
slashes the number of code lines, and allows reusing the same components from one project to
the next.
What are the components we are speaking about? The Sun reference implementation of Java Server Faces
provides just a few very common components
for Web forms, primitive tags for page layout, and
"dataTable" as a way to show the data set. The open source implementations of Java Server Faces don’t
provide much more. The commercial implementation of GUI Tools for Java Server Faces such as
WebSphere Application Developer and Java Studio Creator do come with significant additions to the
set of components that allows creating interfaces similar to that of Swing applications. However,
traditionally, the Web interface lacks all of the richness of thick-client analogs. A customer
might have an existing design that is not covered by the set of standard controls. Third-party
components vendors will try to create the most common components with a multitude of custom
parameters, but still these do not match the requirements for an individual Web application.
The Java Server Faces Specification in Section 1.2.2 mentions the Component Writer role along with Page
Writer and Application Developer roles. Writing a specific component set for a particular Web
application might be a good solution instead of trying to use existing ones that a customer might
not even accept.
|
|
Is it easy to write your own Java Server Faces UI component? Sun’s J2EE tutorial provides a section
dedicated to this topic. This paragraph describes an example with Map components giving an
overview of almost all the features you might need in developing your own components.
However, the example itself seems too complicated to use it as a beginning “kick start” type of
application. It gives a good overview of the technology, but does not give enough details for the
specific steps you would need to go through to write your own components.
This tutorial is dedicated to closing this gap. It is written in a step-by-step manner where
each step is extremely easy to understand. The provided example does not cover all the aspects
of components development, but it is a very good start to understand the idea. Topics not covered
in this tutorial are set forth in the last section.