Using format

ID Email Date Money
38952 email is sit-et@est.com 18-02-2009 1,406.00 $
58854 email is dolor-voluptua@diam.com 03-04-2009 6,276.00 $
75142 email is ut-invidunt@et.com 07-04-2009 0,795.00 $
60641 email is magna-takimata@clita.com 24-04-2009 7,141.00 $
41923 email is dolore-justo@est.com 09-06-2009 8,401.00 $
81627 email is et-ea@consetetur.com 11-07-2009 2,370.00 $
57321 email is duo-et@et.com 08-12-2009 4,027.00 $
39999 email is takimata-justo@nonumy.com 02-01-2010 3,183.00 $
94037 email is Stet-et@ea.com 06-04-2010 8,896.00 $
84954 email is elitr-erat@et.com 13-10-2010 6,550.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>