Skip to Main Content
Mastering JavaServer Faces 2.2
book

Mastering JavaServer Faces 2.2

by Anghel Leonard
June 2014
Intermediate to advanced content levelIntermediate to advanced
578 pages
12h 2m
English
Packt Publishing
Content preview from Mastering JavaServer Faces 2.2

Writing a theme switcher

If you are a PrimeFaces fan, then I'm sure you have seen the PrimeFaces theme switcher. Basically, a theme switcher is represented by a drop-down menu that contains themes' names and thumbnails. End users can switch between application's themes just by selecting it from the list.

In this section, you will see how to develop a theme switcher using the JSF 2.2 contracts. The goal is to obtain a theme switcher so that:

  • It can be added as a JAR in any JSF 2.2 application
  • It can automatically detect and list the themes of an application
  • It can give a nice look and feel, as shown in the following screenshot (shown on the left-hand side is the PrimeFaces theme switcher, and on the right-hand side is our theme switcher)

Obviously, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaServer Faces

JavaServer Faces

Hans Bergsten

Publisher Resources

ISBN: 9781782176466Supplemental Content