title: Passing Parameters in Spring MVC 4.0
body: <p>I have read multiple posts, and have yet to find an answer to my issue.  I have the following controller using Spring 4.</p>
  
  <p>Because of the examples I have found, I have gleaned how to use my WellTest POJO to automatically bind via the @RequestParam.  I can tell you that many times the "Experts" assume way too much of what they themselves do easily every day when explaining this stuff, and I am not a newby by any means.  However, I don't work services very much and in Spring's case, sometimes your only as good as your last version you used.  Mine was around 2.5 or so.</p>
  
  <p>Here is my controller method - it's just for testing the passing of Variables.<div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>@RequestMapping(value = "/update/{WellTestID}", method = RequestMethod.POST,headers="Accept=application/json")
  public String setWellTestByWellTestID( @RequestParam(defaultValue = "99999")  Long wellTestID, 
      @RequestParam(defaultValue = "99999")  Long wellFacilityID, 
      @RequestParam(defaultValue = "101")  int operatorPersonID, 
      @RequestParam(defaultValue = "67845")  int durationSeconds, 
      @RequestParam(defaultValue = "100")  long grossRate, 
      @RequestParam(defaultValue = "400")  long waterCut, 
      @RequestParam(defaultValue = "30")  long percentGas, 
      @RequestParam(defaultValue = "500")  long temperature, 
      @RequestParam(defaultValue = "60")  long flowLinePressure, 
      @RequestParam(defaultValue = "50")  long casingPressure, 
      @RequestParam(defaultValue = "0")   int allocation, 
      @RequestParam(defaultValue = "3")   int wellTestTypeID,  
      @RequestParam(defaultValue = "you")  String createUser,
      @RequestParam(defaultValue = "me-me")  String lastModifiedUser,
      @RequestParam(defaultValue = "4-4-2014") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) Date createDate,              
      WellTest wellTest) throws IOException 
  {
      /* try {
          wellTestService.updateWellTest(wellTest);
      } catch (ParseException e) {
          e.printStackTrace();
      }*/
      
      String param1 = new String(wellFacilityID.toString());
  
      return param1; 
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>The app is for retrieving and editing Well Tests for Oil Wells.  I was able to get every parameter to pass, except when I used a Date datatype.  I am positive it's related to conversion within the binding, but the service will not even error within debugger - The error tells me the request is not syntactically correct and it never gets to the request method.</p>
  
  <p>The error is...</p>
  
  <pre><code>Blockquote
  400 Bad Request Show explanation Loading time: 18
  Request headers 
  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) 
  Chrome/37.0.2062.120 Safari/537.36
  Origin: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo
  Content-Type: application/json 
  Accept: */*
  Accept-Encoding: gzip,deflate
  Accept-Language: en-US,en;q=0.8,de;q=0.6
  Response headers 
  X-Powered-By: Servlet/3.1 JSP/2.3 (GlassFish Server Open Source Edition 4.0 Java/Oracle Corporation/1.8)
  Server: GlassFish Server Open Source Edition 4.0 
  Access-Control-Allow-Origin: *
  Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE
  Access-Control-Max-Age: 3600
  Access-Control-Allow-Headers: x-requested-with
  Content-Language: 
  Content-Type: text/html 
  Date: Wed, 17 Sep 2014 21:29:47 GMT 
  Connection: close
  Content-Length: 1105 
  </code></pre>
  
  <p>My question is simple, and please if you are going to comment or answer, be thorough in both.  Please assume i know next to nothing, and you are the one who can explain it.</p>
  
  <p>How are passed parameters datatypes converted within Spring MVC?  Please explain what to do as well as the concepts behind the why.</p>