jeudi 26 octobre 2017

How to sovle error in casting in a servlet when getting the parameter from a .jsp

I have checked as diligently as I can to find this answer but I can't see the problem

<input type="date" name="dateCreated">

DateFormat df = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);
                java.util.Date newDate = 
df.format(request.getParameter("dateCreated"));

My error reads, "Incompatible type String cannot be converted into Date."




Aucun commentaire:

Enregistrer un commentaire