Example usage for org.springframework.format.datetime.joda JodaTimeContextHolder setJodaTimeContext

List of usage examples for org.springframework.format.datetime.joda JodaTimeContextHolder setJodaTimeContext

Introduction

In this page you can find the example usage for org.springframework.format.datetime.joda JodaTimeContextHolder setJodaTimeContext.

Prototype

public static void setJodaTimeContext(@Nullable JodaTimeContext jodaTimeContext) 

Source Link

Document

Associate the given JodaTimeContext with the current thread.

Usage

From source file:com.springsource.greenhouse.home.DateTimeZoneHandlerInterceptor.java

public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
        throws Exception {
    JodaTimeContext context = new JodaTimeContext();
    context.setTimeZone(getTimeZone(request));
    JodaTimeContextHolder.setJodaTimeContext(context);
    return true;//from   w w  w . j a va  2s. c  o m
}

From source file:name.cphillipson.experimental.gwt.server.interceptor.DateTimeZoneHandlerInterceptor.java

@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
        throws Exception {
    final JodaTimeContext context = new JodaTimeContext();
    context.setTimeZone(getTimeZone(request));
    JodaTimeContextHolder.setJodaTimeContext(context);
    return true;//from   w  ww .  j a v a 2s .c  o  m
}