问题
We should apply primefaces theme for a jsf page
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>bluesky</param-value>
</context-param>
I want to apply for one page this primefaces theme.How to do this?
回答1:
If you add it as a context-param, it will be used for all pages. This is what you need to do:
1 - Get the jar of the bluesky theme and extract it to a folder. We'll use these files later.
2 - In the 'resources' folder create a subfolder called "primefaces-bluesky".
3 - In this folder, copy the file theme.css from the theme and also the 'images' folder.
4 - In the page in which you want to use the theme, include the stylesheet <h:outputStylesheet library="primefaces-bluesky" name="theme.css" />
来源:https://stackoverflow.com/questions/21983736/applying-primefaces-theme-only-for-one-jsf-page