title: Convert date string to Date object in JSP
body: <p>I have a form with some attribute related to an object.
  In this object I have a date object and in my form I recover it like a string.
  Is it possible to fill the date object by the string ?</p>
  
  <p>JSP form declaration :</p>
  
  <pre><code>&lt;form:form method="POST" action="/netmg/controller/device/search/" modelAttribute="device"&gt; 
  </code></pre>
  
  <p>JSP with string value :</p>
  
  <pre><code>&lt;tr&gt;
                  &lt;td class="label"&gt;&lt;spring:message code="device.endDate" /&gt;&lt;/td&gt;
                  &lt;td class="value"&gt;
                      &lt;form:input path="endDate" cssClass="datepickerMe" /&gt;
                      &lt;form:errors path="endDate" cssClass="errormsg" /&gt;
                  &lt;/td&gt; 
              &lt;/tr&gt;
  </code></pre>
  
  <p>Then I recover it like this in my controller :</p>
  
  <pre><code>/**
   *
   * @param device
   * @param bindingResult
   * @param uiModel
   * @return
   */
  @RequestMapping(method = RequestMethod.POST)
  public String findDevicesByCriteria(@Valid @ModelAttribute Device device, BindingResult bindingResult, Model uiModel) {
      if (isCriteriaEmpty(device)) {
          uiModel.addAttribute("criteriaEmptyWarning", "error_search_criteria_empty");
          return ViewConstants.DEVICE_SEARCH_VIEW;
      }
      List&lt;IDevice&gt; deviceList = identityService.searchDevices(device.getSerialNumber(), device.getOwner(), device.getIpAdress(), device.getInstallDate(), device.getEndDate());
      if (deviceList.size() == 0) {
          uiModel.addAttribute(WebConstants.NO_RESULT, true);
      }
      uiModel.addAttribute(WebConstants.DEVICE_LIST, deviceList);
      return ViewConstants.DEVICE_SEARCH_VIEW;
  }
  </code></pre>
  
  <p>Do you have any idea to fill the date object attribute ?</p>