One of the most powerful and interesting features of the Trinidad framework is its support for customizing the appearance of a wide range of user interface elements through the use of a coordinated set of cascading style sheets, images, and other presentational resources.
Different themes can be created and declared as "skins" for the application in a centralized XML file named /WEB-INF/trinidad-skins.xml
. The current skin for the application can be hardcoded in the /WEB-INF/trinidad-config.xml file
, or it can be determined at runtime based on stored user preferences, a predefined schedule, or any other criteria. Additionally, custom Trinidad skins can be defined in a JAR file, enabling them to be reused more easily.
In our demonstration, we declare the skin family as an EL expression bound to a sessionScope
variable named skinFamily
. (This session variable has no special meaning in Trinidad and is not created by default; it is simply used here to demonstrate...