You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by BatiB80 <se...@torexretail.de> on 2007/10/26 10:29:30 UTC

Load Image from another server

Hi,

is it possible to load an image which is located on another server. In my
Page-Class I like to do somethink like this:

add(new Image("myImage", new
SomeKindOfWebReference("http://www.sample.com/sampleImage.gif")));

Can this be provided by the framework or do I have to create my own
WebResource-Implementation which reads the picture in the
getResourceStream()-Method???

Many thanks for you help
Sebastian
-- 
View this message in context: http://www.nabble.com/Load-Image-from-another-server-tf4695833.html#a13422770
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Load Image from another server

Posted by BatiB80 <se...@torexretail.de>.
Think that this is not exactly what I want. I do not want to link to another
site, I want to view an image. But the imageresource isn't located on my
webserver. What I did in my .html-Page:

  img wicket:id="someExternalPic" height="85" width="120"

No I'm trying to replace this with an external resource. I'm searching for
something like:

  add(new Image("someExternalPic", new
SomeKindOfWebReference("http://www.sample.com/sampleImage.gif"));

When I'm adding an ExternalLink, for sure I get an exception that I'm trying
to add a link to some markup of kind image. 

Sorry for the last two postings...

-- 
View this message in context: http://www.nabble.com/Load-Image-from-another-server-tf4695833.html#a13424786
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Load Image from another server

Posted by BatiB80 <se...@torexretail.de>.
Think that this is not exactly what I want. I do not want to link to another
site, I want to view an image. But the imageresource isn't located on my
webserver. What I did in my .html-Page:

   

No I'm trying to replace this with an external resource. I'm searching for
something like:

  add(new Image("someExternalPic", new
SomeKindOfWebReference("http://www.sample.com/sampleImage.gif"));

When I'm adding an ExternalLink, for sure I get an exception that I'm trying
to add a link to some markup of kind image. 
-- 
View this message in context: http://www.nabble.com/Load-Image-from-another-server-tf4695833.html#a13424753
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Load Image from another server

Posted by Swaroop Belur <sw...@gmail.com>.
>> "is it possible to load an image which is located on another server"

try using ExternalLink for this.

add(new ExternalLink("el","<full path>","External Image"));
-swaroop


On 10/26/07, BatiB80 <se...@torexretail.de> wrote:
>
>
> Hi,
>
> is it possible to load an image which is located on another server. In my
> Page-Class I like to do somethink like this:
>
> add(new Image("myImage", new
> SomeKindOfWebReference("http://www.sample.com/sampleImage.gif")));
>
> Can this be provided by the framework or do I have to create my own
> WebResource-Implementation which reads the picture in the
> getResourceStream()-Method???
>
> Many thanks for you help
> Sebastian
> --
> View this message in context:
> http://www.nabble.com/Load-Image-from-another-server-tf4695833.html#a13422770
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Load Image from another server

Posted by BatiB80 <se...@torexretail.de>.
Thanks for your help, it works. 

I added a new class which implements WebResouce. The overridden method
getResourceStream() simply returns a new UrlResourceStream(aUrl);

Thanks, 
Sebastian
-- 
View this message in context: http://www.nabble.com/Load-Image-from-another-server-tf4695833.html#a13452993
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Load Image from another server

Posted by Johan Compagner <jc...@gmail.com>.
i don't think there is a resource yet that has an url in the constructor or
something
But if you look at DynamicWebResource and make your own ResourceState (impl
4 methods)
which just call the same kind of methods of the url class. should be pretty
easy

johan



On 10/28/07, BatiB80 <se...@torexretail.de> wrote:
>
>
> Thanks for the answer. But is there no already existing class in the
> framework which is doing it? Do I have to implement this by myselve???
>
> Regards,
> Sebastian
> --
> View this message in context:
> http://www.nabble.com/Load-Image-from-another-server-tf4695833.html#a13452769
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Load Image from another server

Posted by BatiB80 <se...@torexretail.de>.
Thanks for the answer. But is there no already existing class in the
framework which is doing it? Do I have to implement this by myselve???

Regards,
Sebastian
-- 
View this message in context: http://www.nabble.com/Load-Image-from-another-server-tf4695833.html#a13452769
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Load Image from another server

Posted by Johan Compagner <jc...@gmail.com>.
you want to load the picture on the server?
and stream that to the browser from your server?

Make your own WebResource or DynamicWebResource
that loads the img from an url

johan



On 10/26/07, BatiB80 <se...@torexretail.de> wrote:
>
>
> Hi,
>
> is it possible to load an image which is located on another server. In my
> Page-Class I like to do somethink like this:
>
> add(new Image("myImage", new
> SomeKindOfWebReference("http://www.sample.com/sampleImage.gif")));
>
> Can this be provided by the framework or do I have to create my own
> WebResource-Implementation which reads the picture in the
> getResourceStream()-Method???
>
> Many thanks for you help
> Sebastian
> --
> View this message in context:
> http://www.nabble.com/Load-Image-from-another-server-tf4695833.html#a13422770
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>