MessageFormatColumnDecarator fails on a date property when escapeXml=true -------------------------------------------------------------------------
Key: DISPL-374 URL: http://jira.codehaus.org/browse/DISPL-374 Project: DisplayTag Type: Bug Components: Decorators Versions: 1.1 Reporter: Marco Papini I've tried to use the 'format' attribute of <display:column> tag to decorate a date property, but I get the following error in the log and the column remains unformatted: ERROR MessageFormatColumnDecorator.decorate(66) | Caught an illegal argument exception while trying to format an object with pattern {0,date,dd/MM/yyyy}, returning the unformatted value. Object class is {0,date,dd/MM/yyyy} The problematic column: <display:column property="inizioValidita" sortable="true" escapeXml="true" titleKey="fields.inizioValidita" format="{0,date,dd/MM/yyyy}"/> I've tracked down the problem to the class MessageFormatColumnDecorator, line 62: the columnValue was a String instead of a Date. I think this i caused by another decorator, EscapeXmlColumnDecorator, that converts to String any Object it decorates. So I've tried to use escapeXml="false" in the above column tag and it worked. I think that MessageFormatColumnDecorator should be the first decorator applied and the EscapeXmlColumnDecorator the last one to fulfill the Principle of Least Surprise. BTW, I've also noticed that 4 tests fails when compiling the sources of 1.1 distribution -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ displaytag-devel mailing list displaytag-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/displaytag-devel