Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.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
使用EL在CSS中包含动态值_Css_Jsf 2_Richfaces - Fatal编程技术网

使用EL在CSS中包含动态值

使用EL在CSS中包含动态值,css,jsf-2,richfaces,Css,Jsf 2,Richfaces,我正在使用JSF2和RichFaces4 我有下面的.css文件 .cobrandURL { background-image: url("#{resource['testfolder/#{myBean.site1}:mrk_cobrand.jpg']}"); } 由于“#{myBean.site1}”部分的原因,这不起作用,如何正确地包含此bean的动态值 My.xhtml文件: <h:outputStylesheet library="testfolder/#{myBean.

我正在使用JSF2和RichFaces4

我有下面的.css文件

.cobrandURL {
    background-image: url("#{resource['testfolder/#{myBean.site1}:mrk_cobrand.jpg']}");
}
由于“#{myBean.site1}”部分的原因,这不起作用,如何正确地包含此bean的动态值

My.xhtml文件:

<h:outputStylesheet library="testfolder/#{myBean.site1}" name="style.css" />


谢谢

您是否尝试将其包含在xhtml的
标记中?是的。请参见上面的.xhtml文件Jean.Ok。但是我想说的是,试着把你的风格放在你的xhtml中(而不是css文件中):
.cobrandURL{background image:url(“#resource['testfolder/{myBean.site1}:mrk#u cobrand.jpg'])