有没有办法使用JSF为嵌入式样式表动态创建图像URL?
示例:
<h:head>
<style type="text/css">
.someId { background-image:url(images/example.jpg); }
</style>
</h:head>
(嵌入式CSS不支持使用<h:graphicImage library="images" name="logo.gif" />
。)
答案 0 :(得分:1)
如果我正确理解你的问题:
在我的项目中,我使用过这种风格:
<h1
class="logo"
style="background:url( #{mainMenuNavigationBean.headerImage} ) no-repeat;">
其中mainMenuNavigationBean
是会话bean,我根据某些条件设置headerImage。