membuat komponen image border di tapestry

Untuk source ImageBorder.tml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
 <html xmlns=""

<img src="${imageurl}" width="${width}" height="${height}" style="border: 2px #b3d515 solid;" />

Sedangkan untuk :

 package com.ipi.myweb.components;


import org.apache.tapestry5.annotations.Parameter;
 import org.apache.tapestry5.annotations.Property;

public class ImageBorder {

 @Parameter(required = true)
 private String imageUrl;

 private int width;

 private int height;


Untuk menggunakan component ImageBorder tersebut dalam page

Buat file .tml simpan dengan nama TestComponent.tml

<html t:type="layout2" title="Test Component"

<p>Test Component</p>

<t:imageborder imageurl="${image}" width="110" height="150" />


Kemudian buat file .java dengan nama

package com.ipi.myweb.pages;

import com.ipi.myweb.annotation.ProtectedPage;

 public class TestComponent {

private final static String url = "/Images/331.jpg";

public String getImage(){
 return url;


The End 😀


Published by


Begin a big Process with a bit trying

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s