<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
...
<h:head id="head">
...
</h:head>
<h:body id="body">
...
<h:outputStylesheet name="prime-buttons.css" library="css"/>
<h:outputScript name="prime-buttons.js" library="ext-js"/>
</h:body>
</html>
Danach erscheinen alle <h:commandButton> und andere Buttons im Primefaces Style.
<dependency> <groupId>org.primefaces.themes</groupId> <artifactId>sunny</artifactId> <version>1.0.8</version> </dependency>
Und dann nur noch in der web.xml auswählen:
<context-param> <param-name>primefaces.THEME</param-name> <param-value>sunny</param-value> </context-param>
Oder man bindet das Theme im Page-Template ein:
<h:outputStylesheet name="theme.css" library="primefaces-<theme>"/>
für die Skins verwendet werden. Aus dem heruntergeladenen ZIP wird das Verzeichnis custom-theme nach <web-root>/resources/primefaces-<theme>/ extrahiert, sodass sich darin /images und /jquery-ui-1.9.1.custom.css befindet. /jquery-ui-1.9.1.custom.css wird nach theme.css umbenannt, damit Primefaces es findet. Oder eben wieder über die Anweisung <h:outputStylesheet>.