title: java jsp convert string into time (or date?)
body: <p>Good morning, I'm try to make a jsp page that read from a text a string value in format mm:ss; after, it must convert this string in type time because this value must be saved in a postgres column of type time; now the code is the following:</p>
  
  <pre><code>&lt;%@page import="java.util.List"%&gt;
  &lt;%@page import="java.util.ArrayList"%&gt;
  &lt;%@page import="java.sql.ResultSet"%&gt;
  &lt;%@page import="java.util.Date"%&gt;
  &lt;%@page import="java.util.*"%&gt;
  &lt;%@page import="java.text.*"%&gt;
  &lt;form name="form1" method="post" action="prova.jsp"&gt;
  &lt;input name="tempo" type="text" /&gt;
  &lt;br/&gt;
  &lt;input type="submit" value="Inserisci"&gt;
  &lt;/form&gt;
  
  String tempoperc=request.getParameter("tempo");
  Date data = null;            
  DateFormat df = new SimpleDateFormat("mm:ss");            
  data = df.parse(tempoperc);
  </code></pre>
  
  <p>when execute the jsp page I have the following error:</p>
  
  <pre><code>An exception occurred processing JSP page /prova.jsp at line that contain 
  "data = df.parse(tempoperc);"
  </code></pre>
  
  <p>what is wrong?</p>