Using format

ID Email Date Money
46814 email is labore-rebum@takimata.com 07-06-2009 6,842.00 $
74453 email is no-ipsum@dolore.com 06-09-2010 3,243.00 $
71868 email is sed-sadipscing@magna.com 29-04-2010 2,252.00 $
34579 email is duo-ea@sea.com 18-04-2010 5,194.00 $
71 email is nonumy-Stet@et.com 08-12-2009 4,823.00 $
81080 email is et-nonumy@vero.com 14-06-2009 4,301.00 $
99376 email is tempor-diam@justo.com 22-11-2009 6,583.00 $
81119 email is consetetur-justo@amet.com 02-01-2009 7,294.00 $
92025 email is ut-sed@sadipscing.com 14-12-2008 2,980.00 $
73308 email is At-accusam@sadipscing.com 09-03-2009 2,045.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>