Using format

ID Email Date Money
87823 email is accusam-dolore@justo.com 10-02-2010 8,025.00 $
3047 email is sanctus-diam@et.com 20-03-2009 9,703.00 $
6474 email is amet-est@erat.com 24-05-2009 1,514.00 $
26958 email is ea-amet@aliquyam.com 13-05-2009 0,686.00 $
62533 email is et-At@magna.com 28-03-2009 6,276.00 $
4555 email is takimata-dolores@et.com 02-06-2009 6,316.00 $
85351 email is sanctus-et@kasd.com 16-10-2009 2,962.00 $
56311 email is eos-ea@diam.com 27-07-2010 0,548.00 $
38135 email is aliquyam-et@voluptua.com 04-10-2010 7,256.00 $
93177 email is ut-et@tempor.com 05-04-2010 8,005.00 $


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>