aspose file tools
The moose likes JSF and the fly likes Populate image dynamically in jsf Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Populate image dynamically in jsf" Watch "Populate image dynamically in jsf" New topic
Author

Populate image dynamically in jsf

jajati behera
Greenhorn

Joined: Sep 26, 2012
Posts: 1
Hi,
Anyone could tell me how an image fetching from database will be shown in an application as an icon using JSF. I tried to do it by writing it a method in the bean and this method fetch the image data from db and convert into a type of StreamConent. In jsf, i used <p:graphicImage> as tag to retrive it.But it is not working. Any other way to do this,please advise.

Thanks
metin lapo
Greenhorn

Joined: Oct 05, 2012
Posts: 1
Hi

you are actually half way there
just use a servlet which will serve the image stream
then in your jsf page the value will be your servlets link

it will be sth like

normal html
<img src="http://localhost/myapp/ImageServlet?img=11" alt="Image">

primefaces
<p:graphicImage value="http://localhost/myapp/ImageServlet?img=11" />


I have done this with jsf but not sure about primefaces
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Populate image dynamically in jsf
 
Similar Threads
Image in the Title Bar
How to make an image rerender when its value(src) changes using AJAX.
Chooser
Checksum for Image comparison
Saving image to BD