Repository navigation
Added TimeZone support to Spring i18n - #298
beamerblvd wants to merge 1 commit into
Conversation
Adding support to Spring Framework i18n for use TimeZones. This support is based largely off the Locale support. The TimeZoneResolver interface parallels the LocaleResolver interface and so do most of its implementations. The TimeZoneChangeInterceptor mirrors the LocaleChangeInterceptor. Use of the TimeZoneContextHolder is the same as using the LocaleContextHolder, and the RequestContext and RequestContextUtils classes have TimeZone-related methods that mirror the Locale-related methods. As it does with LocaleResolver, DispatcherServlet now exposes a TimeZoneResolver and context. The JstlUtils take into account and expose TimeZones to the target JSP context, just like with Locales, so that <fmt:formatDate> and the like can take advantage of the selected TimeZone. The Velocity and Jasper Report views have also been updated to use the TimeZone (they were the only other view types whose 3rd party libraries consumed TimeZones but Spring was ignoring that). Everything was set up so that out-of-the-box, Spring and everything it affects continue to use the System Default time zone without configuration to the contrary. This way, behavior should not change for users that don't set up TimeZone support. This change includes 69 unit tests to back up my changes. I have also thoroughly functionally tested the changes in my target application. All new classes are well-documented with JavaDoc and the JavaDoc of classes affected by these changes have been updated as appropriate. Issue: SPR-1528
|
I have signed and agree to the terms of the SpringSource Individual Contributor License Agreement. |
|
Has anyone had a chance to look at this? I'm eager to make any revisions necessary so that we can get this merged. Some of the classes affected ( |
|
According to JIRA, 4.0 M2 releases today. @philwebb said he wanted to get this into Milestone 2, and I share that desire. If there are simple revisions that need to be made, I can turn that around in 2-3 hours this afternoon. If there are more major revisions that need to be made, it's going to take me several days. @jhoeller, has this reached the top of your list yet? |
Added support to Spring Framework i18n for use
TimeZones. Thissupport is based largely off the
Localesupport. TheTimeZoneResolverinterface parallels the
LocaleResolverinterface and so do most ofits implementations. The
TimeZoneChangeInterceptormirrors theLocaleChangeInterceptor. Use of theTimeZoneContextHolderis the sameas using the
LocaleContextHolder, and theRequestContextandRequestContextUtilsclasses haveTimeZone-related methods that mirrorthe
Locale-related methods.As it does with
LocaleResolver,DispatcherServletnow exposes aTimeZoneResolverand context. TheJstlUtilstake into account andexpose
TimeZones to the target JSP context, just like withLocales,so that
<fmt:formatDate>and the like can take advantage of theselected
TimeZone. The Velocity and Jasper Report views have alsobeen updated to use the
TimeZone(they were the only other view typeswhose 3rd party libraries consumed
TimeZones but Spring was ignoringthat).
Everything was set up so that out-of-the-box, Spring and everything
it affects continue to use the System Default time zone without
configuration to the contrary. This way, behavior should not change
for users that don't set up
TimeZonesupport.This change includes 69 unit tests to back up my changes. I have also
thoroughly functionally tested the changes in my target application.
All new classes are well-documented with JavaDoc and the JavaDoc of
classes affected by these changes have been updated as appropriate.
Issue: SPR-1528