Have you tried the following:
WebComponent image = new WebComponent("someWicketId");
image.add(new SimpleAttributeModifier("src", "http://.....jpg"));
add(image);
with markup
<img wicket:id="someWicketId" />
that should work just fine...
if you cannot hardcode the image url, you can use the following
instead of SimpleAttributeModifier
image.add(new AttributeModifier("src", true new
AbstractReadOnlyModel<String>() {
public String getObject() {
String url = ... (fetch the image url from anywhere else)
// e.g. '/xxx/yyyy/image893748.png'
return url;
}
));
2010/1/27 François Meillet <[email protected]>:
> Hi Wicketers,
>
> I have a directory, /xxx/images with uploaded images, which is not under the
> application context root directory.
> How can I serve them as static images ?
>
> I tried the StaticImage class I found in the forum
> (http://old.nabble.com/Plain-IMG-src-urls-td21547371.html#a21547543 )
> but it doesn't work for me. It just work if the image files are under the
> context root directory.
>
> Thanks for your help.
>
> François
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]