Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Configurações necessárias para (de)serializar classes do pacote java.time com o Jackson 2.x em uma API implementada com JAX-RS 2. Testado com o Wildfly 8.2.0.Final.
public class JacksonJavaTimeConfiguration implements ContextResolver<ObjectMapper> {
private final ObjectMapper mapper;
public JacksonJavaTimeConfiguration() {
mapper = new ObjectMapper();
mapper.registerModule(new JSR310Module());
mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
public ObjectMapper getContext(Class<?> type) {
return mapper;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment