Display images from the web
I want to set the image url of a commandButton to the path of an image which is on a precise site. When I do this I have this exception
java.io.FileNotFoundException: http:/7art-screensavers.com/flowers/2004-08-19-flowers-photos/red-white-flower.jpg (No such file or directory)
But the image specified by this url exist.
I don't know what is wrong.
I know that local images could not be displayed correctly without using a servlet permitting this.But that don't work for images from the web.
I also want to display images by specifying urls like this
http://mud.mm-a7.yimg.com/image/3888178633
But this also gives me an exception of (No such file or directory) despite that when I load it in a browser that is displayed.
Please can you help me.
Thanks.
# 2
Yes I'm using Image Servlet and trying to create a File or FileInputStream object with an URL as path
And the sent URL is
http://7art-screensavers.com/flowers/2004-08-19-flowers-photos/red-white-flower.jpg
Because I use a System.out.println to view it.I really don't know why it eliminates the second / when it loads the images.
Also this URL http://mud.mm-a7.yimg.com/image/3888178633 generates a file not found exception despite the fact that the image exist .This url is a thumb url of images .
# 4
I load images dynamically by code creating HTMCommandButton components and then setting the image's URL.
I don't know how to include component into other by code.
How can I please do this
<h:commandLink action="action" actionListener="#{MyBean.Listener}">
<h:graphicImage url="image.jpg"/>
</h:commandLink>
by code.
Thanks