0
Hello personal I have a webservice that should fetch some infections in the database and return a json object and I’m having problems with date.
here is the object
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@XmlRootElement
public class Carro{
@XmlElement
private String id;
@XmlElement
private String nome;
@XmlElement
private Timestamp dtFabricacao;
... gets and setters
}
i go to the database and fill in the class properties normally the date is "dd/mm/yyyy HH:mm:ss z"
but json gets like this
{
"id": 1
"nome": "Fiesta"
"dtFabricacao": 152679516567919
}
I have tried to create a class of serialization and annotations and nothing works anymore I do not know what to do.
I am using Jax and Jackson to convert the object to json and my project uses Maven
Very good, perfect answer and completely useful
– Betini O. Heleno