Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

rendering java.awt.image using JSF

  Asked By: Daisy    Date: Apr 15    Category: Java    Views: 2147
  

I hava a question about <jsf:graphicImage>.
i have an Entity class that has a java .awt.Image field . I want to rendering this image on <jsf:graphicImage> using baking beans.
is there any way to rendering a java.awt.Image to a html <img> tag or <jsf:graphicImage>.

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Chad Bradley     Answered On: Apr 15

It's a backing bean not baking bean.............

 
Answer #2    Answered By: Laurel Collins     Answered On: Apr 15

jsf:graphicImage takes a url to the image,
to render image  object you should:
1) make sure the image object (your entity  or at least its image field) is available after request,
for example if your managed bean scope is request the object will be wiped out
2) create a mechanism to convert object refrence to a url and back
3) give the image refrence as url to jsf:graphicImage

if you want a simpler approach use seam image tag!
this way you will just give the image field  name to the seam jsf  image tag, and it works!

 
Didn't find what you were looking for? Find more on rendering java.awt.image using JSF Or get search suggestion and latest updates.




Tagged: