Added TimeZone support to Spring i18n #298
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added support to Spring Framework i18n for use
TimeZone
s. Thissupport is based largely off the
Locale
support. TheTimeZoneResolver
interface parallels the
LocaleResolver
interface and so do most ofits implementations. The
TimeZoneChangeInterceptor
mirrors theLocaleChangeInterceptor
. Use of theTimeZoneContextHolder
is the sameas using the
LocaleContextHolder
, and theRequestContext
andRequestContextUtils
classes haveTimeZone
-related methods that mirrorthe
Locale
-related methods.As it does with
LocaleResolver
,DispatcherServlet
now exposes aTimeZoneResolver
and context. TheJstlUtils
take into account andexpose
TimeZone
s to the target JSP context, just like withLocale
s,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
TimeZone
s 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
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