0
I’m having trouble recording an empty field as it is being formatted with Simpledateformatt..
Saving the console generates an error
java.text.ParseException: Unparseable date: ""
Servlet
private void gravarProximo(HttpServletRequest request, HttpServletResponse response) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm");
SimpleDateFormat sdf2 = new SimpleDateFormat("dd/MM/yyyy HH:mm");
OrdemServico c = (OrdemServico) request.getSession().getAttribute("ordemServico");
c.setDataOpen(sdf.parse(request.getParameter("dataOpen")));
c.setDataClosed(sdf2.parse(request.getParameter("dataClosed")));
Can someone help me on how to make it record even if the field is empty?
in the database is without null...