Displays an image, deriving the source URL for the image from an asset.

Rollover is a similar component that can create dynamic mouse-over effects as well.

See also: ImageSubmit , Rollover


Name Type Required Default Description
image IAsset yes The image to show.

Body: removed

Informal parameters: allowed

Reserved parameters: src


Inserts the static context path based image.

This example uses a <context-asset> to reference the image.

PoweredByTapestry Screen Shot

HTML Template

<table cellpadding="8" valign="middle">
  <a href="">
   <img jwcid="@Image" image="asset:imageAsset" alt="View Tapestry Home"/>
  <font color="navy" size="+2"><b><i>Powered by Tapestry</i></b></font>

Page Specification

<asset name="imageAsset" path="/images/poweredby.png"/>

Inserts the dynamic image obtained from the page's NewsItem property.

This example uses the ExternalAsset to reference the image's URL.

Image Screen Shot

HTML Template

<table cellpadding="8">
  <h4><span jwcid="@Insert" value="ognl:newsItem.title"/></h4>
  <span jwcid="@Insert" value="ognl:newsItem.body"/>
  Date : <span jwcid="@Insert" value="" format="ognl:@NewsItemPage@DATE_FORMAT"/>
  <img jwcid="@Image" image="ognl:newsItem.imageAsset" alt="ognl:newsItem.summary"/>

Page Specification

<property name="orderItem" type="com.dsconsulting.cms.model.NewsItem"/>

Java classes

public abstract class NewsItemPage extends BasePage {
    public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd MMM yyyy");

    public abstract NewsItem getNewsItem();

public class NewsItem implements Serializable {
    private String title;
    private String body;
    private String summary;
    private Date date;
    private String imageURL;

    public NewsItem(String title, String summary, String body, Date date,
            String imageURL) {
        this.title = title;
        this.body = body;
        this.summary = summary; = date;
        this.imageURL = imageURL;

    public String getTitle() { return title; }

    public String getBody() { return body; }

    public String getSummary() { return summary; }

    public String getDate() { return date; }

    public IAsset getImageAsset() { return new ExternalAsset(imageURL, null); }