Applying PrimeFaces theme only for one JSF page

北战南征 提交于 2019-12-21 20:24:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!