仅将PrimeFaces主题应用于一个JSF页面 [英] Applying PrimeFaces theme only for one JSF page
问题描述
我们应该为jsf页面应用primefaces主题
We should apply primefaces theme for a jsf page
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>bluesky</param-value>
</context-param>
我想申请一张以Primefaces为主题的页面.该怎么做?
I want to apply for one page this primefaces theme.How to do this?
推荐答案
如果将其添加为上下文参数,它将用于所有页面.这是您需要做的:
If you add it as a context-param, it will be used for all pages. This is what you need to do:
1-获取bluesky主题的jar并将其提取到文件夹中.我们稍后将使用这些文件.
2-在资源"文件夹中,创建一个名为"primefaces-bluesky"的子文件夹.
3-在此文件夹中,从主题以及"images"文件夹复制文件theme.css.
4-在要使用主题的页面中,包含样式表<h:outputStylesheet library="primefaces-bluesky" name="theme.css" />
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" />
这篇关于仅将PrimeFaces主题应用于一个JSF页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!