
Summary
We have now come to the end of the chapter and achieved a lot. While we pat ourselves on the shoulder or drink a well-earned cup of coffee/tea, let us review what we have done up to now.
We had a brief look at the difference between standard JSF and PrimeFaces components in terms of the HTML that is generated for them. One of the issues with standard JSF components is the lack of accessibility support. By default, PrimeFaces addresses this issue.
We added extra themes to the project and then set the appropriate context parameter in web.xml
to use one of them instead of the default aristo
theme. We then added code that displays the name of the current theme being used. We created two JavaBeans, which allow us to set and change the theme for each user independent of the application settings as well as provide a list of themes that a user can choose from.
In order to make things easier when adding content to the project, we created a Facelets Template, which can be used to add standard content to each of the pages, that is, a Facelets Template Client of the template. We also displayed the currently chosen theme. To top it all, we added a ThemeSwitcher component to it as well.
We then created the home page for the project as a Facelets Template Client. We also created a mini showcase for PrimeFaces components and linked this page to the template.
In the mini showcase, we also added buttons, which enabled us to change themes without using the ThemeSwitcher.
What we didn't do is change the difference.xhtml
page to use chaptersTemplate
. This is left as an exercise for you.
We touched on how we read and write to Bean properties using EL expressions, the way EL shields us from the complexity of whether to call a getter property method or a setter property method, and how we can explicitly set a property value.
All in all, we achieved a lot. Well done!
In the next chapter, we will look at the frameworks used to develop and use a PrimeFaces theme—jQuery, jQuery UI, and ThemeRoller.