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.

[822 byte] By [WebServicea] at [2007-11-27 5:50:05]
# 1
http:/7art-screensavers.com/ This is indeed an invalid URL.But I don't see how this could generate a FileNotFoundException error. Are you using an ImageServlet and trying to create a File or FileInputStream object with an URL as path?
BalusCa at 2007-7-12 15:37:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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 .

WebServicea at 2007-7-12 15:37:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
An URL is not a valid file path. Just use the plain url in the <img src> or <h:graphicImage value> instead of passing it to the ImageServlet.
BalusCa at 2007-7-12 15:37:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 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

WebServicea at 2007-7-12 15:37:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
parentComponent.getChildren().add(newChildComponent);
BalusCa at 2007-7-12 15:37:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...