Custom Components in JSF

    I`ve been working as Java developer for more than 4 years now and I definitely can    say that I’m not bored, I like my job.  I want to think for it more like an art as John  Romero says: ” You might not think that programmers are artists, but programming is  an extremely creative profession. […]

by Velina Doycheva

September 1, 2015

2 min read

2015 09 01 18 33 52 Windows Media Player - Custom Components in JSF

603756_1038622349500382_5531686501381052335_n    I`ve been working as Java developer for more than 4 years now and I definitely can    say that I’m not bored, I like my job.  I want to think for it more like an art as John  Romero says: ” You might not think that programmers are artists, but programming is  an extremely creative profession. It’s logic-based creativity.”  That`s why I always try  to personalize the technology stack I work with. You know, to give the code a little  styling. That`s why when my colleagues asked me to give a Frydix talk the topic was  easily chosen: Custom Components in JSF

 

 The bases

Just a quick hint for the beginners. JSF (JavaServer Faces) is a Java-based web application framework intended to simplify development integration of web-based user interfaces. What`s great about JSF is that it  provides developers with a powerful capability to define own custom components which can be used to render custom contents.

UI components in JSF

JSF provides developers capability to create web application from collections of UI components that can render themselves in different ways for multiple client types (for example HTML browser, wireless or WAP device).

  • javax.faces.component.UIComponent
    • Java class that is responsible for representing a self-contained piece of the user interface
  • Renderer
    • helper to the UIComponent that deals with how that specific UIComponent class should appear in a specific kind of client device.

The real deal

Ready to start? In the next slides you`ll learn how to use a custom renderer and when to/when not to use custom components.  You`ll see how to create:

  • composite component
  • custom tag
  • custom validator
  • custom converter 

    Enjoy!

[slideshare id=52294160&doc=customcomponents2-150901132332-lva1-app6892]

 

Useful resources:

Categories

Java EE Developer at Dreamix