public void postHandle(
     HttpServletRequest request,
     HttpServletResponse response,
     Object handler,
     ModelAndView modelAndView)
     throws Exception {
   if (modelAndView != null) {
     modelAndView.addObject("jodaTimeContext", JodaTimeContextHolder.getJodaTimeContext());
   }
 }
Example #2
0
 private void setTimeZoneForDateTimeFilter() {
   JodaTimeContext jodaTimeContext = getJodaTimeContext();
   // check JodaTimeContext first and use it if set
   if (jodaTimeContext != null)
     engine.getConfiguration().setTimezone(jodaTimeContext.getTimeZone().toTimeZone());
   else { // try attrib param next
     String timeZone = (String) getAttributesMap().get(PARAM_TIMEZONE);
     if (timeZone != null) {
       engine.getConfiguration().setTimezone(TimeZone.getTimeZone(timeZone));
       JodaTimeContext context = JodaTimeContextHolder.getJodaTimeContext();
       if (context == null) context = new JodaTimeContext();
       context.setTimeZone(DateTimeZone.forID(timeZone));
       JodaTimeContextHolder.setJodaTimeContext(context);
     }
   }
 }