如何使用tapestry实现图片管理功能

xusaomaiss 2008-05-12
本人想实现一个管理WebRoot\images下的图片,有谁有好的方式,通过@image组件显示图片,存图片也实现了。但希望有人能提供个好的方式来实现管理图片。
我现在的方式是,建了一张表,用于保存图片的信息。

create table imageDB{
int id not null, //流水号
varchar(50) imageName not null, //图片名
varchar(100) memo, //备注
varchar(50) tip //这个是标签
}

以上建表是临时写的,就是那些字段。

一个函数是自动把image文件夹下的所有图片插入表中。
我现在是对页面如何有效展现图片,
从数据库中读取图片路径:
在页面类中实现IAsset接口

    public IAsset getNewsImage(){  
        return new ExternalAsset(getPictureUp(), null);  
        //getPictureUp()用以获取数据库中图片路径  
    }  

public IAsset getNewsImage(){
    return new ExternalAsset(getPictureUp(), null);
    //getPictureUp()用以获取数据库中图片路径
}


HTML页面模板中
<img jwcid="@Image" image="ognl:newsImage" height="200" border="0"/>

这个方法可以解决一个图片的显示,但如果使用table呢?有什么好方法?
xusaomaiss 2008-05-12
我是想实现以下这们的功能:

http://www.all-open.com/php/pic/2339.htm
tapestry 2008-05-12
table组件,还是html中的table,取出你想显示的图片,放到list中,在页面迭代输出。