jQuery datepicker with Spring MVC - Passing date from view to controller sends null
<p>After submitting the form , I see all the values being passed properly to the controller except date which is passed as null(The date selection in the form enters a proper date in the input field) I tried adding  but it did not help. I also tried removing "path" and replacing it with "name" in the "" but it throws error saying "path" attribute is missing. I tried following  but no luck-<br>
1. <a href="https://stackoverflow.com/questions/33009729/in-spring-web-mvc-application-date-value-is-received-as-null-in-controller-after">In spring web mvc application date value is received as NULL in controller after reading from date-picker on jsp page</a><br>
2. <a href="http://blog.teamextension.com/date-binding-in-spring-mvc-1321" rel="nofollow noreferrer">http://blog.teamextension.com/date-binding-in-spring-mvc-1321</a> </p>

<p>jQuery:
<code>$(document).ready(function() {
    $("#datepicker").datepicker({dateFormat:"yy-mm-dd"});
    });</code></p>

<p>JSP: </p>

<pre><code>&lt;div class="plLabelSearch" id="hiddenField"&gt;Due Date:&lt;/div&gt; 
&lt;div class="plinput"&gt;&lt;form:input type="text" id="datepicker" path="dueDate" placeholder="yyyy-mm-dd"/&gt;&lt;/div&gt;
</code></pre>

<p>Model:</p>

<pre><code>@Column(name = "DUE_DATE")  
@DateTimeFormat(pattern = "yyyy/mm/dd")  
private Date dueDate;
</code></pre>

<p>Controller:</p>

<pre><code>@RequestMapping(value="/lock", method = RequestMethod.POST)  
 public @ResponseBody Status lockDevice(@ModelAttribute("adminTransaction") @Validated AdminTransaction adminTransaction, BindingResult result, Model model, Locale locale,Map&lt;String, Object&gt; map, HttpServletRequest request) {
     try {
         /*.......CODE.........*/
         adminTransactionDO.setDueDate(adminTransaction.getDueDate());
        /*.......CODE.........*/
         }
         return new Status("success", "Transaction inserted Successfully !");  
          } catch (Exception e) {  
           return new Status("error", e.toString());  
          }
}
</code></pre>