I'm having trouble writing an empty field because it's being formatted with SimpleDateFormatt ..
Writing 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 anyone help me with how to make it write even if the field is empty?
In the database there is no null ...