【发布时间】:2021-04-15 11:42:51
【问题描述】:
显示 p:graphicImage 动态内容让我已经忙了好几天了。谁能帮帮我,我将不胜感激。
我有一个直接的 p:graphicImage 方法,将 imgage.jpg 的 StreamedContent 加载到一个列表(TreeMap)中。
这是我的 xhtml sn-p:
<p:dataView var="id"
value="#{fotoViewer.imagesViewTree.entrySet()}"
gridIcon="pi pi-th-large" listIcon="pi pi-bars">
<p:dataViewListItem>
<h:panelGrid columns="2" style="width:100%" columnClasses="">
<p:graphicImage value="#{id.value.streamedImage}"
style="max-width: 30vw; max-height: 53vh;" cache="false"
stream="true" styleClass="w3-round-xlarge" />
<p:outputPanel>
<h:panelGrid columns="2" cellpadding="5">
<h:outputText value="Id:" />
<h:outputText value="#{id.key}" style="font-weight: bold" />
<h:outputText value="naam:" />
<h:outputText value="#{id.value.naam}" style="font-weight: bold" />
</h:panelGrid>
</p:outputPanel>
</h:panelGrid>
</p:dataViewListItem>
</p:dataView>
我可以在我的浏览器中看到动态内容,就可以判断而言,它看起来不错,这里是:
(img id="cac010:j_id_11:0:j_id_14" src="/cJsfComponents1/faces/javax.faces.resource/dynamiccontent.properties?ln=primefaces&v=8.0&pfdrid=8ca67d0788631c82cdee936b119abf8e&pfdrt=2&pfdrid_c=dfed=false&uid=false&uid -4b5f-80b8-b7868dac9f10" alt="" class="w3-round-xlarge" style="max-width: 30vw; max-height: 53vh;")
我不明白为什么服务器不提供 contentStream。它以 http-status-code-404 响应。
提前感谢您的帮助!
【问题讨论】:
标签: primefaces http-status-code-404 dynamic-content graphicimage