Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何在JSF中使用/创建主题?_Css_Jsf_Jsf 2_Themes - Fatal编程技术网

Css 如何在JSF中使用/创建主题?

Css 如何在JSF中使用/创建主题?,css,jsf,jsf-2,themes,Css,Jsf,Jsf 2,Themes,我有一个表格,类似这样: <html> <head> <!-- Some css file included here --> </head> <body> <!-- Form parameters like action, method omitted for simplicity--> <form> <p

我有一个表格,类似这样:

<html>
    <head>
        <!-- Some css file included here -->
    </head>
    <body>

        <!-- Form parameters like action, method omitted  for simplicity-->
        <form>
            <p class="someTextClass">msg[code.text]</p>
            <input class="someInputClass" type="text"/>
            <button class="someButtonClass">msg[code.button]</button>
            <p class="someHelpTextClass">msg[code3.help]</p>
        </form
    </body
</html>

msg[code.text]

msg[代码.按钮]

msg[code3.help]


你能升级到JSF2.2吗?这个概念就是你要寻找的

或者,您可以从支持bean中获取适当的主题样式:

webapp/
  resources/theme1/css/styles.css
  resources/theme2/css/styles.css


<h:outputStyleSheet library="#{someBean.theme}" name="css/styles.css"/>
webapp/
参考资料/theme1/css/styles.css
参考资料/theme2/css/styles.css
由于outputStyleSheet也可以使用EL作为名称,因此您也可以将该代码推送到bean中

对于pageTemplate本身,您可能应该考虑从bean获取该信息

希望有帮助