Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery - $.ajax POST does not send .data to web server

I am using the JQuery $.ajax post command to invoke an ajax event on my web server:

var formParams = "fe1=y&fe2=m&fe3=m";

$.ajax({
    type: 'POST',
    url: '/foo.jsp',
    async: false,
    data: formParams,
    complete: function(xmlRequestObject, successString){
        ymmReceiveAjaxResponse(xmlRequestObject, successString);
    }
});

The ajax component successfully calls the web page, but it does not include any of the post data.
ie - "(HttpServletRequest) request.getParameterMap.size() == 0" - I'd expect 3, but am getting zero.

Changing the above command from POST to a GET makes everything work just fine.

TIA

like image 204
Eyeless Whim Avatar asked Apr 08 '11 14:04

Eyeless Whim


1 Answers

The cause of the problem was found using FireBug and opening the opening the Net gadget.

I'm seeing that the web server is responding with a status 302 on the call to the web page.

Expanding upon the 302 request in Firebug/Net, and examining the Params, Headers, Response, and HTML quickly identified that it was an application specific issue originating on the server.

Thanks for everyone's feedback

like image 152
Eyeless Whim Avatar answered Oct 24 '22 16:10

Eyeless Whim