When using @DateTimeFormat("S-"), the "S-" is interpreted as a Joda DateTime "style code" -- we simply delegate to Joda's printing and parsing behavior for that code. You could change what "S-" means, but you'd need to plug in a custom DateTimeFormatAnnotationFormatterFactory to do this. You might consider instead registering a custom Formatter<Date> and Formatter<BigDecimal> that applies to all Dates and BigDecimal fields (so conversion would be driven by type, not annotation, and no field annotation would be required then). To register a custom Formatter, you need to subclass FormattingConversionServiceFactoryBean, override the installFormatters(FormatterRegistry) hook, register your customizaitons, and finally inject the ConversionService produced by this FactoryBean into your mvc:annotation-driven element. You might find it helpful to review the super implementation which installs the default Joda-based @DateTimeFormat support, as well as the default @NumberFormat support.
I also recommending reading the reference documentation in this area and reviewing the mvc-showcase, which has working examples of customizing the registered set of Converters/Formatters.
Hope this gets you going.
Keith
Last edited by Keith Donald; Dec 8th, 2010 at 09:36 PM.
Keith Donald
Core Spring Development Team