How to pass JSON array from AngularJS Controller to the Spring Controller?
<p>I am making SPA using AngularJS in Spring 4 with Hibernate 5.</p>

<p>I'm getting an error while passing JSON array from the AngularJS controller to the Spring Controller.</p>

<p>All fields value successfully coming in angular JSON array, but not passing in Spring controller.</p>

<blockquote>
  <p>Error: Could not read JSON: ; nested exception is
  com.google.gson.JsonSyntaxException:</p>
</blockquote>

<p>My project structure is like below.</p>

<blockquote>
  <p>Spring_Hibernate_MVC
  =src
  -com->karmesh->mvcApp->controller->register->RegisterController.java
  =WebContent
  -js->app->RegisterController.js
  -Views->Register.html</p>
</blockquote>

<p>Register,html</p>

<pre><code>&lt;div id="DivRegisterMain" ng-controller="RegisterController"&gt;   
    &lt;form name="myForm" novalidate&gt;

:::://Form fields here.
        &lt;input type="submit" value="SubmitTest" ng-click="submit()" &gt;&lt;br&gt;
    &lt;/form&gt;

&lt;/div&gt;
</code></pre>

<p>app.js</p>

<pre><code>var routeApp=angular.module("RouteApp",['ngRoute']);
</code></pre>

<p>RegisterController.js</p>

<pre><code>routeApp.controller("RegisterController", function($scope, $http) {

    $scope.regJson = {
        "is" : 1,   
        "fname" : "",
        "lname" : "",
        "gender" : "",
        "dob" : "",
        "email" : "",
        "contact" : "",
        "yop" : "",
        "degree" : "",
        "branch" : "",
        "perc" : "",
        "state" : "",
        "city" : ""

    };

$scope.studentList = [];

$scope.submit = function() {

        var req = {
                 method: 'POST',                 
                 url: 'http://localhost:8050/Spring_Hibernate_MVC/registerStudent.do',              
                 data: $scope.studentList,

        };

        $http(req).
        then(function(response){
            console.log(response); // prints true or false
            if (response)
              console.log("in success");
            else 
               console.log("in fail");
            $scope.studentList=[];
        }, function(response){
            console.log(response.status);
            console.log("in error");

        });


    };
</code></pre>

<p>RegisterController.java</p>

<pre><code>@EnableWebMvc
@RestController
@RequestMapping("/")
public class RegisterController {

    @Autowired
    private RegisterService registerService;

    public RegisterController() {
        System.out.println(this.getClass().getSimpleName() + "created..");
    }


    @ResponseBody
    @RequestMapping(value="/registerStudent.do", method = RequestMethod.POST)   
    public boolean registerStudent(@RequestBody List&lt;RegisterDTO&gt; stdList) {    
        System.out.println("inside controller..");

        if (stdList != null) {  
        System.out.println("success...");
          }
          return registerService.isStudentExist(stdList);

    }
}
</code></pre>