Java Reference
In-Depth Information
Of course, in this chapter, we only scratched the surface of JSF features. There is also a
new higher-level approach introduced in JSF 2.2 that can be used for flow-based scenarios
such as a shopping cart. The new feature is called FacesFlow and comes with a @FlowS-
coped annotation. However, we will now focus on adding some other features to our cur-
rent application.
Combining the scheduler into our application
Up to now, we have not included the scheduler, which was in charge of simulating other
customer-requesting tickets, into our application. This was not an oversight; as a matter of
fact, introducing an external system in a web application poses some challenges. For ex-
ample, what if the scheduler updates some data used by the application? How will the user
know it?
There are several strategies to address this requirement; however, they all boil down to us-
ing some intelligence in your client application. For example, if you are familiar with web
scripting languages, you can use the popular jQuery API to poll the server for some up-
dates. The newest version of JSF 2.2 comes with great support for HTML5 and JavaScript
frameworks, thanks to the custom data attributes and pass-through elements. These are
simple mechanisms that allow the JSF's render kit to render parts of the page without any
further changes so that custom tags may be interpreted by the browser (or a JavaScript
Since not all Java EE developers might be skilled in JavaScript, we would rather show a
simple and effective way to fulfill our requirement using RichFaces libraries ( ht-
tp:// ) , which provide advanced Ajax support along with a rich set
of ready-to-use components.
Installing RichFaces
Installing RichFaces requires a set of core libraries that are generally available at the
RichFaces download page.
Additionally, you need to provide a set of third-party dependencies that are used by the
RichFaces API. Never mind, that's what Maven is for! Start by adding the latest Bill of
Materials ( BOM ) for the RichFaces API in the upper dependency-management sec-
Search WWH ::

Custom Search