---
title: "Jmesa开始Taglib计划"
author: "我想我是海"
date: "2007-07-23T12:13:18Z"
tags: []
slug: "jmesa-taglib"
draft: false
lastmod: "2007-07-23T12:13:18Z"
id: 104398
url: "https://bbmyth.iteye.com/blog/104398"
---

[Jmesa](http://code.google.com/p/jmesa/)社区最近有个提交了一套TagLib的实现。使用方法是这样：

xml 代码

 

1. 1. &lt;ensco:table id="exampleTable" exportable="true" numRows="5"&gt;
2. 2.        &lt;ensco:column displayName="Property 1" propertyName="prop1" cellEditor="someEditor"/&gt;
3. 3.        &lt;ensco:column displayName="Property 2" propertyName="prop2"  filterable="false" /&gt;
4. 4.        &lt;ensco:column displayName="Property 3" propertyName="prop3" sortable="false" filterable="false" /&gt;
5. 5.      ensco:table&gt;

Taglib作者说是Display Tag风格。不过个人很不爽的是，居然还需要开发者去实现cellEditor？并且不支持Column Tag里面嵌套内容的用法。很不实用。我跟Jeff沟通后，他也很赞成我的观点。于是我昨天花了几个小时写了一套新的Taglib。归功能Jmesa API的优雅及易用，TagLib很快就可以工作了。我实现有TagLib用法这样：

xml 代码

 

1. &lt;jm:table id="product" items="products" caption="product listing"
2. export="csv,pdf" style="jmesa" width="100%"&gt;
3. &lt;jm:column name="id" title="edit"&gt;
4. &lt;a href="viewProduct.action?id=&lt;jm:property&gt;"&lt;/jm:property&gt;&gt;&lt;jm:property
5. name="name"/&gt;a&gt;
6. jm:column&gt;
7. &lt;jm:column name="price" sortable="true" filterable="true"/&gt;
8. &lt;jm:column name="createdTime" width="20%"/&gt;
9. jm:table&gt;

开发者只需要提供一个Collection，写JSPTag，不需要实现其他任何接口。  
我给Jeff发了封Email: [another jmesa taglib](http://groups.google.com/group/jmesa/browse_thread/thread/9a3e4b506c292776)Jeff相当感兴趣，马上制订了[Jmesa Taglib的规范](http://code.google.com/p/jmesa/wiki/Tags)，让社区去实现TagLib。呵，Jeff的相法与我制订的Tag的出发点是相当的一致啊。是不是因为我也叫Jeff的原因？偶是（Jeff jie）。可以到[这里](http://groups.google.com/group/jmesa/browse_thread/thread/55cc48f7610683db)看看偶的TLD文件与Jeff的说法 ：）  
这两天会继续抽时间，按照规范把原来的Tag作一下小的修改。再发给Jeff看看。争取成为官方实现版本 ：P。

Jmesa相关文章：  
 [jmesa系列之一：什么是Jmesa](../../../admin/show/89567)[]()   
 **[jmesa系列(二)Jmesa源码的包结构解读](../../../admin/show/89570)**  
**[Jmesa系列（三）](http://bbmyth.iteye.com/admin/show/95768)**[开始使用JMesa]()