Closed spring-operator closed 14 years ago
Rossen Stoyanchev commented
The Spring 3 type conversion integration is now fully functional.
Applications should be able to continue to work without making any changes. However all type conversion will now be routed through Spring's type conversion with the exception of named, custom converters.
The samples have been updated. Noteworthy changes are the addition of a dependency on org.joda.time and the removal of the "shortDate" named converter in swf-booking-mvc and booking-portlet-mvc in favor of @DateTimeFormat
annotations in Booking.java.
Applications can also start registering custom Spring 3 formatters and formatting annotations through Spring's FormattingConversionServiceFactoryBean. In Spring MVC applications this is commonly configured via
Rossen Stoyanchev opened SWF-1234 and commented
Currently Spring Web Flow applications rely on a type conversion system that is different from the mechanism used in Spring MVC, which relied on the java.beans.PropertyEditor abstraction. Spring 3 offers a modern type conversion mechanism influenced by Web Flow's type conversion mechanism. Of interest to web applications is the Formatter SPI and the annotation-driven formatting:
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/validation.html#format
The purpose of this ticket is to integrate the new Spring conversion system into Web Flow such that Web Flow applications can take advantage of it and use a single type conversion mechanism. The specific goals are:
After this change all type conversion in Web Flow will rely on Spring's type conversion system. Existing custom converters can be registered as before via registered via GenericConversionService.addConverter(Converter converter). Such converters will be adapted and registered for use withing Spring's type conversion system.
Web Flow also provides support for named converters that can be added via GenericConversionService.addConverter(String id, Converter converter). Such converters can then be used in conjunction with data binding. Named converters will continue to be supported for backwards compatibility but will be deprecated and will not result in the use of Spring's type conversion mechanism.
Why applications should consider rewriting existing custom converters? Formatters are smart with regards to generics, formatting annotations (including custom annotations) provide fine-grained control over formatting, a single mechanism can be used across Spring MVC and Spring Web Flow.
Affects: 2.0.9
Issue Links:
267 Conversion fails for genric typed class
("is depended on by")
354 Upgrade Web Flow to Spring 3
("is depended on by")