title: Get the dd-MM-yyyy format of date in Java (JSP)
body: <p>I'm using an input=date calendar, and i want to output this format of date (dd-MM-yyyy) in my jsp ,when i choose the 2nd day of april 2014 in the calendar given by the input ,I have this output in my jsp:</p>
  
  <p>Wed Apr 02 00:00:00 WET 2014</p>
  
  <p>Here you are the code:</p>
  
  <p><strong>index.jsp</strong> :</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;JSP Page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form name="datepickeer" action="showdates.jsp" method="POST"&gt;
              &lt;table&gt;
                  &lt;tr&gt;&lt;td&gt;Date début :&lt;/td&gt; &lt;td&gt;&lt;input type = "date" name = "datedebut"&gt;
                      &lt;/td&gt;&lt;tr&gt;
                  &lt;tr&gt;&lt;td&gt;&lt;input type = "submit" name = "submit" value = "submit"&gt;
                      &lt;/td&gt;&lt;/tr&gt;
              &lt;/table&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>showdates.jsp</strong> :</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;%@ page import="java.util.Date,java.text.SimpleDateFormat,java.text.ParseException"%&gt;
  &lt;%@page import="java.text.SimpleDateFormat"%&gt;
  &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;JSP Page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;% String dateStr = request.getParameter("datedebut");
              SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
              Date result = formater.parse(dateStr);
              out.println(result);
          %&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What's the problem with my code?</p>