passing date from jsp to servlet using getParameterValues
<p>I am having error in servlet to pass the value from JSP.. </p>

<p>JSP codes :</p>

<pre><code>&lt;table&gt;                 
&lt;tr&gt;
    &lt;td&gt;Day&lt;/td&gt;
    &lt;td&gt;Start&lt;/td&gt;
    &lt;td&gt;End&lt;/td&gt;
    &lt;td&gt;Date&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;                                                          
&lt;/tr&gt;               
&lt;tr&gt;
   &lt;td&gt;&lt;select name="availableDay"&gt;  
       &lt;!--Listing days--&gt;                                                                                         
       &lt;/select&gt;&lt;/td&gt;
   &lt;td&gt;&lt;input type="time"   name="availableStart"/&gt;&lt;/td&gt;
   &lt;td&gt;&lt;input type="time"   name="availableEnd"/&gt;&lt;/td&gt;
   &lt;td&gt;&lt;input type="date"   name="availableDate" /&gt;&lt;/td&gt;
   &lt;td&gt;&lt;input type="button" class="add" name="action" value="Add More"&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>I want to pass <code>availableDate</code> to servlet. Fyi, the row in JSP is dynamically generated. Thus, I pass using <code>[]</code>. My servlet codes :</p>

<pre><code>  public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, java.io.IOException {

  String[] presentationID = request.getParameterValues("selectavailability");
  String[] availableDay =  request.getParameterValues("availableDay"); 
  String[] availableStart =  request.getParameterValues("availableStart");
  String[] availableEnd =  request.getParameterValues("availableEnd");
  String[] availableDate = request.getParameterValues("availableDate");  

  SimpleDateFormat availDate = new SimpleDateFormat("dd-MM-yyyy");
  Date chosenDate = availDate.parse(availableDate);// THIS IS WHERE I AM GETTING ERROR

  try {

        if(availableDay != null &amp;&amp; availableStart != null &amp;&amp; availableEnd != null)
        {
          for (int i = 0; i &lt; availableDay.length; i++) 
          {

            AvailabilityBean available = new  AvailabilityBean(); 
            available.setLecturerID(request.getParameter("lecturerID"));
            available.setAvailableDay(availableDay[i]);
            available.setAvailableStart(availableStart[i]);
            available.setAvailableEnd(availableEnd[i]);
            available.setAvailableDate(availableDate[i]); //EFFECTED THIS LINE TOO

            available = AddAvailableDAO.addavailable(available);


           }
        }

     }
                   response.sendRedirect("addAvailability.jsp");                
 }
catch (Throwable theException) {
            System.out.println("hhhhhhh"+theException);
        }
    }
</code></pre>

<p>For extra, AvailabilityBean:</p>

<pre><code>    private String availableID;
    private String lecturerID;
    private String availableDay;
    private String availableStart;
    private String availableEnd;
    private Date availableDate;
    private String presentationID;
</code></pre>

<p>Error : <code>incompatible types: String[] cannot be converted to String.</code></p>

<p>Can you show me where is my mistake? And how can i solve this? Thank you</p>