title: Getting null in spring-boot REST request param from HTML form
body: <p>I've an HTML form where I'm getting 2 inputs, which is submitted to a spring boot <code>REST</code> api. But in this simple application, I'm still receiving <code>null</code> as request in backend api.</p>
  
  <p><strong>Form</strong></p>
  
  <pre><code>&lt;div&gt;
      &lt;label&gt;alphaID&lt;/label&gt;  
      &lt;div&gt;
          &lt;input id="alphaID" name="alphaID" type="text"/&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
      &lt;label class="col-md-4 control-label"&gt;Domain Name&lt;/label&gt;  
      &lt;div class="col-md-4"&gt;
          &lt;input id="domain" name="domain" type="text"/&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Upon submit, I'm calling ajax call, like:</p>
  
  <pre><code>function formSubmit() {
      $("#productForm").submit(function(e) {
          e.preventDefault();
          var requestJson = createRequestJSON();
          var url = config.myurl;
          $.ajax({
              url: url,
              type : "POST",
              data: JSON.stringify(requestJson),
              success: function( data, textStatus, jQxhr ) {
                  console.log("sucess: " + data);
              },
              error: function( jqXhr, textStatus, errorThrown ){
                  console.log( "error: " + errorThrown );
              }
          });
      });
  }
  </code></pre>
  
  <p>The backend is a spring-boot application with REST call:</p>
  
  <pre><code>@RequestMapping(value = "/validate", method = RequestMethod.POST,
          consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
  public Map&lt;String, List&lt;String&gt;&gt; validate(@Valid MyDTO myDTO) {
  
      System.out.println(myDTO.getId());          // GETTING null
      System.out.println(myDTO.getDomain());      // GETTING null
  
  }
  </code></pre>
  
  <p><strong>MyDTO.java</strong></p>
  
  <pre><code>public class MyDTO {
      @JsonProperty("alpha_id")
      private String alphaID;
  
      @JsonProperty("domain")
      private String domain;
  
      ....
  }
  </code></pre>