I have a little problem with a service. When I receive a list of json the date is null, I think that is because json haven't date type. Is there a way to solve it and receive the real date and not null?
Im going to post some important code, thank you very much.
ServiceController
@RequestMapping(value="evento9", method=RequestMethod.GET, produces = "application/json")
public ResponseEntity<?> evento9(@RequestParam(value="localizacion", required=true) String localizacion){
ListaEventos listaComodin = new ListaEventos();
listaComodin.setListaEvento(eventoDAO.findBySalaEvento(localizacion));
return new ResponseEntity<>(listaComodin,HttpStatus.OK);
}
Controller
Client client = ClientBuilder.newClient();
WebTarget webResource = client.target("http://localhost:8086").path("evento9")
.queryParam("localizacion", localizacion);
ListaEventos eventoComodin = webResource.request().accept("application/json").get(ListaEventos.class);
request.setAttribute("eventos", eventoComodin.getListaEvento());
request.getServletContext().getRequestDispatcher("/busqueda.jsp").forward(request,response);
Get y Set
@JsonDeserialize(using = CustomJsonDateDeserializer.class)
public Date getFechaEvento() {
return this.fechaEvento;
}
@JsonDeserialize(using = CustomJsonDateDeserializer.class)
public void setFechaEvento(Date fechaEvento) {
this.fechaEvento = fechaEvento;
}