title: Knockout js form submit to spring controller
body: <p>How to pass form parameters into spring controller.
  I need to submit the below form into this url "submit.htm".</p>
  
  <pre><code>&lt;form data-bind="submit: save" action="forms/submit.htm" method="post"&gt;
      &lt;fieldset&gt;
          &lt;legend&gt;User: &lt;span data-bind='text: errors().length'&gt;&lt;/span&gt; errors&lt;/legend&gt;
          &lt;label&gt;First name: &lt;input data-bind='value: firstName'/&gt;&lt;/label&gt;
          &lt;label&gt;Last name: &lt;input data-bind='value: lastName'/&gt;&lt;/label&gt;
      &lt;/fieldset&gt;
      &lt;button  type="submit"&gt;Go&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>var viewModel = {
      firstName: ko.observable().extend({
          required: true,
          minLength: 2,
          maxLength: 10
      }),
      lastName: ko.observable().extend({
          required: true
      }),
      tasks: ko.observableArray([]),
      save: function() {
          if (viewModel.errors().length == 0) {
              ko.utils.postJson($("form")[0], this);
          } else {
              alert('Please check your submission.');
              viewModel.errors.showAllMessages();
          }
      }
  };
  
  viewModel.errors = ko.validation.group(viewModel);
  ko.applyBindings(viewModel);
  </code></pre>
  
  <p>this is going to my controller.
  But I didnot get those parameters in my controller. Also I dont know the way to get these params in my controller.</p>