Scusa se rispondo con ritardo.
Questo è il codice:
E questo è l'errore che ottengo nell'utilizzare l'input type date al posto del text:codice:<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <form action="/Prova/Inserimento" method="GET"> <div class="form-group"> <label for="nome">Nome</label> <input type="text" class="form-control form-control-sm" id="nome" name="nome" placeholder="Nome" required> </div> <div class="form-group"> <label for="cognome">Cognome:</label> <input type="text" class="form-control form-control-sm" id="cognome" name="cognome" placeholder="Cognome" required> </div> <div class="form-group"> <label class="control-label col-sm-2" for="dataNascita">Data di nascita:</label> <input type="date" class="form-control" id="dataEmissione" name="dataEmissione"> </div> <button type="submit" class="btn">Invia</button> </form> </div> </body> </html>
java.lang.NullPointerException
at java.text.SimpleDateFormat.parse(SimpleDateFormat. java:1439)
at java.text.DateFormat.parse(DateFormat.java:364)
at utility.ManipolazioneDate.convertiData(Manipolazio neDate.java:17)
at servlet.Inserimento.doGet(Inserimento.java:45)




Rispondi quotando