To send an ajax request, we have number of functions in jQuery. But to send JSON object along with the request, I chose jQuer.ajax(). It takes various parameters url, type, data, dataType, beforeSend etc.
See below steps
Here Json objects has not been written directly as data: jsonObjects. because it expects that the JSON object passed to it, written as key value pair. Therefore we made students the key.
Now I need to expand the json objects -
//this code written in grails
List students = JSON.parse(params.students) //students in request params is parsed to json objects and stored in the List
println "Student id: " + students.studentId //first element of the students list is accessed as a map holding a key studentId