渔人码头

天行健,君子以自强不息。地势坤,君子以厚德载物。
posts - 12, comments - 16, trackbacks - 0, articles - 43
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

DisplayTag1.1用法记录

Posted on 2008-02-26 22:06 Fisher 阅读(382) 评论(0)  编辑  收藏 所属分类: 开源组件
1、直接使用column的format属性,进行格式化输出。

You can use any valid java.text.MessageFormat pattern in the format attribute. Sorting will be based on the original object, not on the formatted String.

Note that errors due to an invalid pattern/object combination (for example trying to format a String like a number) will not be rethrown. Instead, an error log will be written and the original unformatted object displayed.

You can also use a format pattern along with column decorators (the pattern will be applied after the decoration).

  <display:table name="test">
    
<display:column property="id" title="ID" />
    
<display:column property="email" format="email is {0}" />
    
<display:column property="date" format="{0,date,dd-MM-yyyy}" sortable="true"/>
    
<display:column property="money" format="{0,number,0,000.00} $" sortable="true"/>
  
</display:table>

只有注册用户登录后才能发表评论。


网站导航: