title: How to set date type values using Apache Commons BeanUtils,
body: <p>I have an Html form with <code>enctype="multipart/form-data"</code> . I have an <code>dto</code> class it has all <code>setter</code> and <code>getters</code>. Since I am submitting form as multipart, <code>getParameter()</code> method will not work,to process html form fields I used Apache Commons BeanUtils. My servlet is as follow,</p>
  
  <pre><code>List&lt;FileItem&gt; items = (List&lt;FileItem&gt;) new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
  for (FileItem item : items) {
  if (item.isFormField()) {
  // Process regular form field (input type="text|radio|checkbox|etc", select, etc).
  String fieldname = item.getFieldName();
  String fieldvalue = item.getString();
  System.out.println(fieldname);
  System.out.println(fieldvalue);
  // ... (do your job here)
  //getters and setters
  try {if((!fieldname.equals("dob"))&amp;&amp;(!fieldname.equals("doj"))){
               BeanUtils.setProperty(teacherInfo, fieldname, fieldvalue);}
  } catch (IllegalAccessException e) {
      e.printStackTrace();
  } catch (InvocationTargetException e) {
      e.printStackTrace();
  }
  
  } else {
  
          //Code for file upload
   }
  </code></pre>
  
  <p>My problem is I am unable to process the date type variables , thats why I m ignoring to set two date values in above code and in above code for some html fields, value are not set by Beans setProperty() method . Can any one tell me where I am wrong . .</p>