Create a new class Example Form in the package de.laliluna.tutorial.Add two properties, name of type String and age of type String. The action form class provides a method validate() which is called before the action class is executed. So you can validate your properties within this method. errors.creditcard= is an invalid credit card number.
Swing already provides a mature way to automatically update the GUI based solely on the internal data status, but JSF does not have good support for refreshing the GUI based on a request from the server side.
If you check the standard life cycle of JSF, you will find that the user normally needs to produce an event on the Web page (by clicking a button, for example) to invoke the GUI refresh.
The poll results and the real-time trading data are dynamic elements that are unknown until run time, but elements that should be added or updated when the server side sends a signal. A previous developer Works article, "Craft Ajax applications using JSF with CSS and Java Script, Part 2: Dynamic JSF forms" explains how to hide and display optional JSF components without refreshing a Web page.
However, you can't use the method described in that article to solve this problem.
Listing 1 shows how to register and de-register listeners to a class.