O'Reilly logo

JavaServer Faces by Hans Bergsten

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required