How to get values of a jquery object in spring controller

var getAccessValues = {};
$(function(){
    $('.toggle_checkbox').change(function() {
        if (check === null) {
        } else {
            if (this.name == check) {
                incr++;
            } else {
                incr = 1;
            }
        }
        var tval = $(this).val();
        check = this.name;

        if (!getAccessValues[this.name]) {
            getAccessValues[this.name] = [];
        }
        getAccessValues[this.name][incr] = tval;
    });
});

function display() {
    $.ajax({
        type: "POST",
        url: "/CRM_Spring/ViewAccessRights/multipleUpdate",
        data: "getRights="+getAccessValues,
        success: function(msg) {
            alert("successfully transfered");
        }
    }); 
}

I want to know if I am passing my getAccessValues object in the right way. Also, I want to know how to retrieve values from this object in my spring controller. Thanks in advance.

@RequestMapping(value="/multipleUpdate",method=RequestMethod.POST)
public String updateMultipleAccessRights(@RequestParam("getRights") String RightsArray)
{
}


Source: ajax

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.