You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniele Dellafiore <il...@gmail.com> on 2011/06/07 23:46:30 UTC

ContextImage and external URL

Hi.

I take some user uploaded images from an external service that answer
at, say, localhost:8181/images
My wicket app run on localhost:9191/app
I want to load the images from the first service, and I'd like to use
a ContextImage that is easy to use:

 new ContextImage("picture", "images/ + code);

This of course does not work cause the base of the ContextImage points to 9191.

I could use something else but I like ContextImage, One idea is to
have something like a filter set up in web.xml that redirect each call
to /images to a custom url like localhost:8181/images.

What do you think? Also, I really do not have a clear idea on how to
do that in a nice way, any tip?

-- 
Daniele Dellafiore
http://danieledellafiore.net

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


Re: ContextImage and external URL

Posted by Martijn Dashorst <ma...@gmail.com>.
I would create your own 'ContextImage' that does exactly what you
want. Extend component, override oncomponenttag and put the model
value into the src attribute.

Martijn

On Tue, Jun 7, 2011 at 11:46 PM, Daniele Dellafiore <il...@gmail.com> wrote:
> Hi.
>
> I take some user uploaded images from an external service that answer
> at, say, localhost:8181/images
> My wicket app run on localhost:9191/app
> I want to load the images from the first service, and I'd like to use
> a ContextImage that is easy to use:
>
>  new ContextImage("picture", "images/ + code);
>
> This of course does not work cause the base of the ContextImage points to 9191.
>
> I could use something else but I like ContextImage, One idea is to
> have something like a filter set up in web.xml that redirect each call
> to /images to a custom url like localhost:8181/images.
>
> What do you think? Also, I really do not have a clear idea on how to
> do that in a nice way, any tip?
>
> --
> Daniele Dellafiore
> http://danieledellafiore.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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


Re: ContextImage and external URL

Posted by Daniele Dellafiore <da...@dellafiore.net>.
Do you think that can be good also if I want to let the browser cache some
images? I serve  thumbnails that I do not want to be server every time.

On Tue, Jun 7, 2011 at 11:52 PM, Martin Grigorov <mg...@apache.org>wrote:

> use Image with DynamicImageResource which loads the image with
> urlConnection
>
> On Tue, Jun 7, 2011 at 11:46 PM, Daniele Dellafiore <il...@gmail.com>
> wrote:
> > Hi.
> >
> > I take some user uploaded images from an external service that answer
> > at, say, localhost:8181/images
> > My wicket app run on localhost:9191/app
> > I want to load the images from the first service, and I'd like to use
> > a ContextImage that is easy to use:
> >
> >  new ContextImage("picture", "images/ + code);
> >
> > This of course does not work cause the base of the ContextImage points to
> 9191.
> >
> > I could use something else but I like ContextImage, One idea is to
> > have something like a filter set up in web.xml that redirect each call
> > to /images to a custom url like localhost:8181/images.
> >
> > What do you think? Also, I really do not have a clear idea on how to
> > do that in a nice way, any tip?
> >
> > --
> > Daniele Dellafiore
> > http://danieledellafiore.net
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Daniele Dellafiore
http://danieledellafiore.net

Re: ContextImage and external URL

Posted by Martin Grigorov <mg...@apache.org>.
use Image with DynamicImageResource which loads the image with urlConnection

On Tue, Jun 7, 2011 at 11:46 PM, Daniele Dellafiore <il...@gmail.com> wrote:
> Hi.
>
> I take some user uploaded images from an external service that answer
> at, say, localhost:8181/images
> My wicket app run on localhost:9191/app
> I want to load the images from the first service, and I'd like to use
> a ContextImage that is easy to use:
>
>  new ContextImage("picture", "images/ + code);
>
> This of course does not work cause the base of the ContextImage points to 9191.
>
> I could use something else but I like ContextImage, One idea is to
> have something like a filter set up in web.xml that redirect each call
> to /images to a custom url like localhost:8181/images.
>
> What do you think? Also, I really do not have a clear idea on how to
> do that in a nice way, any tip?
>
> --
> Daniele Dellafiore
> http://danieledellafiore.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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