简体   繁体   English

没有?pfdrid_c = true的Primefaces graphicImage

[英]Primefaces graphicImage without ?pfdrid_c=true

I am trying to render a graphic image in primefaces but always returns a 404. In Chrome Debug I can see the address image like this: 我正在尝试以素数形式渲染图形图像,但始终返回404。在Chrome Debug中,我可以看到如下所示的地址图像:

/UltracarWeb/Images/1427303591376_image.png?pfdrid_c=true"

Using the Chrome Debug I changed for: 使用Chrome调试后,我更改为:

/UltracarWeb/Images/1427303591376_image.png?pfdrid_c=false" , then the image is rendered.

I call the graphicImage in xhtml this way: 我用这种方式在xhtml中调用graphicImage:

 <p:graphicImage  style="max-width: 110px; max-height: 140px;"
                 value="#{product.PhotoUrl}"                                                          
                 rendered="#{not empty product.Url}">                                                        
</p:graphicImage>

I already tryed with cache false and true, and still not work. 我已经尝试过使用false和true缓存,但仍然无法正常工作。

The url is not empty because I checked this in the Debug. 网址不为空,因为我在调试中检查了此网址。 Debugging the java code I saw the product.url without the ?pfdrid_c=true, but in browser Debug the ?pfdrid_c=true appears. 调试Java代码时,我看到了没有?pfdrid_c = true的product.url,但是在浏览器调试中出现了?pfdrid_c = true。

This ?pfdrid_c=true is a primefaces constant do refers the dynamic cache, but I don't know how can I remove it? 这个?pfdrid_c = true是质数常量,它确实引用了动态缓存,但是我不知道如何删除它?

I have had the same problem with this component of primefaces to images, because it adds the parameter ?pfdrid_c=true used to control the Cache-Control 我在图像的素数部分中遇到了相同的问题,因为它添加了用于控制Cache-Control的参数?pfdrid_c=true

I was using it like this (primefaces element): 我正在这样使用它(primefaces元素):

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"...>


<p:graphicImage value="#{product.PhotoUrl} />

and I chose to use this other jsf element that works perfectly for me since it does not introduce parameter: 并且我选择使用另一个对我来说完美的jsf元素,因为它没有引入参数:

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"...>


<h:graphicImage value="#{product.PhotoUrl} />

This works only if the value is a String representing an URL but this does not work if the value is a DefaultStreamedContent . 仅当值是表示URL的String时,此方法才有效;但如果值是DefaultStreamedContent则不起作用。 This isn't supported by <h:graphicImage> <h:graphicImage>不支持此功能

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM