How to load an external image has been created by August Detlefsen (Dec 27, 2006).

Content:

How can I load an image directly from a url?

For example I want to display a picture of a user next to their profile,
but all of the images are served by another machine for better
performance.

class StaticImage extends WebComponent {

public StaticImage(String id, IModel model)

Unknown macro: { super(id, model); }

protected void onComponentTag(ComponentTag tag)

Unknown macro: { checkComponentTag(tag, "img"); tag.put("src", getModelObjectAsString()); }

}

add(new StaticImage("img", new Model("http://foo.com/bar.gif"));

Thanks to Igor Vaynberg

Reply via email to