【发布时间】:2015-01-24 09:05:03
【问题描述】:
我有以下 primefaces 组件,它应该只加载 /WEB-INF/Resource/{1.png,2.png,3.png,4.png} 下的图像。
<p:ring id="weatherForecasts" value="#{eventPageCreatorBean.weatherForecasts}" var="weatherForecast" styleClass="image-ring" easing="easeInOutBack">
<p:panelGrid columns="1">
#{weatherForecast.forecastStart}
<p:graphicImage id="img" name="/WEB-INF/Resources/images/#{weatherForecast.weatherCondition.code}.png" />
#{weatherForecast.forecastEnd}
</p:panelGrid>
</p:ring>
通过在浏览器中查看源代码,我得到了这条路径:
/meteocal-web/javax.faces.resource//WEB-INF/Resources/images/1.png.xhtml
有人知道怎么解决吗?
【问题讨论】:
-
What is the JSF resource library for and how should it be used?。 (将它们存储到应用程序根目录下名为
resources的文件夹中)。
标签: jsf url primefaces graphicimage