Using Java Classes as Views
As you’ve seen, JSF components are
implemented as regular Java classes
extending the javax.faces.component.UIComponent
class, and can be instantiated and manipulated programmatically. The
JSF component actions you use in the JSP pages create instances of
these classes and configure them based on the custom action
attributes, as discussed in Chapter 13 and 14.
If you come from a standalone GUI development background, working
directly with instances of component classes may feel more familiar
than messing around with special elements in a JSP page. The first
custom ViewHandler we look at supports this
development model with JSF views implemented as regular Java classes,
similar to the classes used for a Java Swing interface.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access