Rajendra Gupta
Rajendra Gupta

Reputation: 379

Unable to send data from javascript to spring controller

var edit = $('#edit .fr').html();

I am sending this value to spring controller using AJAX .

ajaxRequest('POST', 
            JSON.stringify(data), 
            'application/json; charset=utf-8', 
            makeURL('submit') +
                    '?edit' +
                    edit,
            okFunc, 
            errorFunc);

Now in my spring controller, I get the value of edit as null.

@RequestParam(value="edit", required=false)String  edit

Any help would be appreciated.

Upvotes: 0

Views: 56

Answers (1)

Vinay Rao
Vinay Rao

Reputation: 1284

Your error could be at the part where you build the URL. Looks like the equal sign is missing:

makeURL('submit') + '?edit=' + edit,

Upvotes: 1

Related Questions